作曲家找不到包friendofsymfony / user-bundle

时间:2013-07-16 11:43:22

标签: php symfony composer-php

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

作曲家版本为6a1262e675b5c1c2c7b1cc58a14028f67885b880

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

2 个答案:

答案 0 :(得分:2)

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

{"minimum-stability": "dev"}

这是因为您选择了FOSUserBundle (2.0.*@dev)的开发版本,并且由于最小稳定性,作曲家找不到此版本。

答案 1 :(得分:0)

刚才遇到同样的问题并通过对Rpg600建议的略微改变解决了这个问题:

直接在composer.json中输入“friendsofsymfony / user-bundle”:“2.0.*@dev”,然后运行

$ composer.phar update friendsofsymfony/user-bundle

我唯一与Rpg600建议不同的是指定要更新的包,但在我的情况下,这有效。