0

我正在尝试通过作曲家安装 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不存在的依赖项。

我该如何解决?

4

1 回答 1

1

该软件包nikic/php-parser仅被标记为 beta 版本 1.0,而不是稳定版本。

theseer/phpdox确实需要那个 1.0.0 版本,但是它已经设置minimum-stability:dev并且prefer-stable:true在它自己的composer.json. 这些设置只能在 root 中定义composer.json

修复它的两种方法:

  1. 自己需要该软件包的所需 beta 版本:composer require nikic/php-parser:~1.0@beta会这样做。
  2. 还将最低稳定性设置至少设置为“beta”,并添加 prefer-stable 标志以避免让所有包都处于 beta 稳定性。

阅读安装说明,我知道您不应该直接通过 Composer 需要此工具。我看不出不这样做的理由,但这可能没有预料到。所以可选的第 3 步:在 Github 上开一张票来解决这个问题。

于 2014-09-01T20:17:54.410 回答