2

我对作曲家有疑问。当我在 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"
    }
}
}

Composer 版本为 6a1262e675b5c1c2c7b1cc58a14028f67885b880

有人可以告诉我我做错了什么吗?

4

2 回答 2

3

你肯定有 {"minimum-stability": "stable"},在你的 composer.json 中,将它设置为

{"minimum-stability": "dev"}

这是因为您选择了一个开发版本FOSUserBundle (2.0.*@dev)而作曲家由于最低稳定性而找不到该版本。

于 2013-07-16T12:21:26.623 回答
1

刚才遇到了同样的问题,稍微修改一下Rpg600的建议就解决了:

把 "friendsofsymfony/user-bundle": "2.0.*@dev" 直接放到composer.json中,然后运行

$ composer.phar update friendsofsymfony/user-bundle

我所做的与 Rpg600 建议的唯一不同的是指定要更新的捆绑包,但在我的情况下这是可行的。

于 2014-07-04T21:48:10.197 回答