我对composer有问题。当我在cmd 中使用此命令时
php composer.phar require friendsofsymfony/user-bundle
我收到这个消息
Please provide a version constraint for the friendsofsymfony/user-bundle requirement: 2.0.*@dev
composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package friendsofsymfony/user-bundle could not be found in any version, there may be a typo in the package name.
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.
Installation failed, reverting composer.json to its original content.
和composer.json文件:
{
"name": "symfony/framework-standard-edition",
"description": "The "Symfony Standard Edition" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"gregwar/captcha-bundle": "dev-master",
"eko/feedbundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.2-dev"
}
}
}
作曲家版本为6a162e675b5c1c2c7b1cc58a14028f67885b880
有人能告诉我我做错了什么吗?
您肯定有{"minimum-stability": "stable"}
,在您的composer.json中,将其设置为
{"minimum-stability": "dev"}
这是因为你选择了FOSUserBundle (2.0.*@dev)
的开发版本,而composer由于稳定性最低而找不到这个版本。
刚才也遇到了同样的问题,并对Rpg600的建议进行了轻微的更改:
将"friendsofsymfony/user bundle":"2.0.*@dev"直接放在composer.json中,然后运行
$ composer.phar update friendsofsymfony/user-bundle
我所做的与Rpg600建议不同的唯一一件事是指定要更新的捆绑包,但在我的情况下,这起到了作用。