我正在尝试通过composer安装phpdox。
"require": {
"phploc/phploc": "2.0.6",
"phpunit/phpunit": "4.2.4",
"pdepend/pdepend": "2.0.0",
"phpmd/phpmd": "2.0.0",
"squizlabs/php_codesniffer": "2.0.0a2",
"sebastian/phpcpd": "2.0.*@dev",
"theseer/phpdox": "0.6.6.1"
}
它产生以下内容:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
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
- Installation request for theseer/phpdox 0.6.6.1 -> satisfiable by theseer/phpdox[0.6.6.1].
- theseer/phpdox 0.6.6.1 requires nikic/php-parser >=1.0.0 -> 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
然而,在packagist网站上,它说phpdox有一个不存在的依赖nikic/php-parser: >=1.0.0
。
我该如何解决?
包nikic/php-parser
仅被标记为测试版1.0,而不是稳定版本。
theseer/phpdox
确实需要1.0.0版本,但它在自己的composer.json
中设置了minimum-stability:dev
和prefer-stable:true
。这些设置只能在根composer.json
中定义。
两种修复方法:
- 您自己需要该软件包所需的测试版:
composer require nikic/php-parser:~1.0@beta
可以做到 - 还将最低稳定性设置为至少"beta",并添加首选稳定标志,以避免所有软件包都处于beta稳定性
阅读安装说明,我得到的想法是,你不应该直接通过Composer需要这个工具。我看不出为什么不这么做,但这可能是意料之中的事。所以可选的第3步:在Github上打开一个票证来解决这个问题。