我正在尝试在我将基于Cilex创建的项目上更新PHPUnit版本。它有PHPUnit版本~3.7
。当我运行composer require phpunit/phpunit:~6 --dev
时,它打印出来:
Problem 1
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- phpunit/phpunit 6.3.0 requires phpunit/php-code-coverage ^5.2.2 -> satisfiable by phpunit/php-code-coverage[5.2.2].
- Installation request for phpunit/phpunit ^6.3 -> satisfiable by phpunit/phpunit[6.3.0].
- Installation request for phpunit/php-code-coverage (locked at 1.2.18) -> satisfiable by phpunit/php-code-coverage[1.2.18].
然而,它不会说哪个包是违规的。作曲家文件为this one。
PS:
另外,为了以防万一,我运行composer require php:~7.1
并且它有效,但在此之后更新PHPUnit仍然无效。
答案 0 :(得分:2)
--update-with-dependencies
运行
$ composer require phpunit/phpunit:^6.0.0 --update-with-dependencies
在同时更新其依赖关系时更新phpunit/phpunit
。
请参阅https://getcomposer.org/doc/03-cli.md#require:
- - 依赖更新:还更新新所需包的依赖关系。
如果这没有帮助,请运行
$ composer why-not phpunit/phpunit:^6.0.0
列出无法安装软件包的原因。