当我运行composer.phar时,安装似乎一切都很好:
→ sudo php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for FOS\JsRoutingBundle into web/bundles/fosjsrouting
etc etc但是现在,我想要安装这个包:来自https://packagist.org/packages/knplabs/knp-paginator-bundle的https://packagist.org/packages/knplabs/knp-paginator-bundle
因此,我用新的要求行更新composer.json文件。
{
"require": {
"knplabs/knp-paginator-bundle": "v2.1"
}}
(我已经尝试过来自packegist的每个版本的分页器,但仍然是相同的错误)
然后我试着安装它:
→ sudo php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/framework-standard-edition 2.1.x-dev -> satisfiable by symfony/framework-standard-edition[2.1.x-dev].
- symfony/framework-standard-edition 2.1.x-dev requires knplabs/knp-paginator-bundle v2.1 -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.以及我当前composer.json的composer.json行:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"symfony/symfony": "2.1.x-dev" did not help我该怎么办?
发布于 2014-01-09 22:37:14
过了几个小时,我终于找到了解决办法!
我不知道我的composer.json依赖关系是否处于最佳状态,但解决问题的是只更新和安装所需的包!
哇?我刚才说了什么?是的,只有所需的捆绑所以..。
sudo php composer.phar require 然后通过https://packagist.org的作曲家酷搜索找到你想要的东西。
从列表中选择数字并填写版本。
它将下载包,更新composer.json和composer.lock文件:)
希望这个答案能帮助到别人!
发布于 2014-01-09 18:41:05
您应该在项目目录中运行此命令:
php composer.phar updatehttps://stackoverflow.com/questions/21023860
复制相似问题