基本上我有这个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.
我不知道这意味着什么?感谢
在实际回答您的问题之前:
您已将项目称为phpunit/phpunit
,并且对phpunit/phpunit
有需求。这是一个循环依赖。你应该把你的项目称为其他东西。
此外,我怀疑你是"Sebastian Bergmann",所以你应该更改作曲家文件中的作者姓名和电子邮件地址。
好的,对于您的实际问题,Composer默认情况下不会安装开发包。你需要明确地告诉它通过放置来安装开发包
"最低稳定性":"dev"
在项目的根composer.json文件中,或者更改PHPUnit不使用开发包的要求,例如
"require": {
"phpunit/phpunit": "3.8.*"
},
除非您正在积极调试另一个包中的问题,否则您不太可能真正想要使用该包的开发版本。你几乎总是想要一个真正的标记版本。