2

基本上我有这个 composer.json 文件:

{
    "name": "phpunit/phpunit",
    "require": {
        "phpunit/phpunit": "3.8.*@dev"
    },
    "authors": [
        {
            "name": "Sebastian Bergmann",
            "email": "sebastian@phpunit.de"
        }
    ]
}

当我运行“composer install”时,出现以下错误:

Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for phpunit/phpunit 3.8.*@dev -> satisfiable by phpunit/phpunit[3.8.x-dev].
    - phpunit/phpunit 3.8.x-dev requires phpunit/php-code-coverage 1.3.*@dev -> 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.

我不知道这意味着什么?谢谢

4

1 回答 1

4

在实际回答您的问题之前:

您已经调用了您的项目phpunit/phpunit,并且您对phpunit/phpunit. 这是一个循环依赖。您应该将您的项目称为其他名称。

另外,我怀疑您是“Sebastian Bergmann”,因此您应该更改作曲家文件中的作者姓名和电子邮件地址。

好的,对于您的实际问题,默认情况下 Composer 不会安装开发包。您需要通过放置明确告诉它安装开发包

“最低稳定性”:“开发”

在项目的根 composer.json 文件中,或将 PHPUnit 的要求更改为不使用 dev 包,例如

"require": {
    "phpunit/phpunit": "3.8.*"
},

除非您正在积极调试另一个包中的问题,否则您实际上不太可能想要使用该包的开发版本。您几乎总是想要一个实际的标记版本。

于 2013-07-09T13:26:48.483 回答