У меня установлена версия php 7.0.29 на моей установке vagrant в Windows 10.
Когда я запускаю следующую команду
composer require --dev phpunit/phpunit
Я получаю ошибки, как уже упоминалось
Using version ^6.5 for phpunit/phpunit
./composer.json has been updated
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
- Conclusion: don't install phpunit/phpunit 6.5.8
- Conclusion: don't install phpunit/phpunit 6.5.7
- Conclusion: don't install phpunit/phpunit 6.5.6
- Conclusion: don't install phpunit/phpunit 6.5.5
- Conclusion: don't install phpunit/phpunit 6.5.4
- Conclusion: don't install phpunit/phpunit 6.5.3
- Conclusion: don't install phpunit/phpunit 6.5.2
- Conclusion: don't install phpunit/phpunit 6.5.1
- phpunit/dbunit 2.0.3 conflicts with phpunit/phpunit[6.5.0].
- phpunit/phpunit 6.5.0 conflicts with phpunit/dbunit[2.0.3].
- phpunit/phpunit 6.5.0 conflicts with phpunit/dbunit[2.0.3].
- Installation request for phpunit/phpunit ^6.5 -> satisfiable by phpunit/phpunit[6.5.0, 6.5.1, 6.5.2, 6.5.3, 6.5.4, 6.5.5, 6.5.6, 6.5.7, 6.5.8].
- Installation request for phpunit/dbunit (locked at 2.0.3, required as ^2.0) -> satisfiable by phpunit/dbunit[2.0.3].
Мой файл composer.json имеет следующий код
{
"name": "tsawler/acme",
"authors": [
{
"name": "xyz",
"email": "[email protected]"}
],
"require": {
"filp/whoops": "2.0.*",
"vlucas/phpdotenv": "~1.1",
"illuminate/database": "5.1.*",
"altorouter/altorouter": "1.1.0",
"respect/validation": "~1.0",
"duncan3dc/blade": "2.2.*",
"robmorgan/phinx": "^0.4.5",
"symfony/var-dumper": "^2.7",
"cocur/slugify": "^1.2",
"swiftmailer/swiftmailer": "^5.4",
"kunststube/csrfp": "^0.1.0",
"sunra/php-simple-html-dom-parser": "v1.5.0",
"rdlowrey/auryn": "1.1.*",
"fabpot/goutte": "^3.1"},
"autoload": {
"psr-4": { "Acme\\": "src/" }
},
"require-dev": {
"phpunit/phpunit": "^5.1",
"phpunit/php-invoker": "^1.1",
"phpunit/dbunit": "^2.0"}
}
Как мне это исправить?
Вам требуются старые версии:
"phpunit/php-invoker": "^1.1",
"phpunit/dbunit": "^2.0"
Тем не менее, phpunit требует более актуальной версии этих зависимостей, как сказано здесь:
- phpunit/dbunit 2.0.3 conflicts with phpunit/phpunit[6.5.0].
- phpunit/phpunit 6.5.0 conflicts with phpunit/dbunit[2.0.3].
- phpunit/phpunit 6.5.0 conflicts with phpunit/dbunit[2.0.3]
Требуется только phpunit/phpunit
вместо этого, и пусть composer обрабатывает свои зависимости вместо того, чтобы требовать каждую зависимость.
Других решений пока нет …