我正在尝试通过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
,它不存在。
我该如何解决?
答案 0 :(得分:1)
包nikic/php-parser
仅被标记为测试版1.0,而非稳定版。
theseer/phpdox
确实需要1.0.0版本,但它已在其自己的minimum-stability:dev
中设置了prefer-stable:true
和composer.json
。这些设置只能在根composer.json
中定义。
两种解决方法:
composer require nikic/php-parser:~1.0@beta
会这样做。阅读安装说明我认为您不应该直接通过Composer来使用此工具。我看不出有什么不这样做的原因,但这可能没有预料到。所以可选步骤3:在Github上打开一张票,以解决这个问题。