composer require --dev phpunit/phpunit
我得到以下信息:
composer require --dev phpunit/phpunit
Using version ^6.2 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
- Installation request for sebastian/object-enumerator (locked at 2.0.1) -> satisfiable by sebastian/object-enumerator[2.0.1].
- phpunit/phpunit 6.2.0 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.1 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.2 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.3 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- Conclusion: don't install sebastian/object-enumerator 3.0.2
- Installation request for phpunit/phpunit ^6.2 -> satisfiable by phpunit/phpunit[6.2.0, 6.2.1, 6.2.2, 6.2.3].
Installation failed, reverting ./composer.json to its original content.
這是我作曲的JSON文件:
"require": {
"php": "^7.0",
"laravel/framework": "^5.4",
"guzzlehttp/guzzle": "^6.3",
"symfony/psr-http-message-bridge": "^1.0",
"mcamara/laravel-localization": "^1.2",
"laravelcollective/html": "^5.4",
"laravel/socialite": "^3.0",
"yajra/laravel-datatables-oracle": "^7.9"
},
"require-dev": {
"fzaninotto/faker": "^1.6",
"symfony/css-selector": "^3.3",
"symfony/dom-crawler": "^3.3"
}
我試圖讓版本5.4以上,並總是得到一個類似的錯誤,但與其他依賴,似乎工作的唯一版本是5.0
我用你的composer.json文件創建了一個新項目(製作一個作曲者安裝),然後啓動命令'composer require --dev phpunit/phpunit'沒有任何問題。嘗試啓動一些調試命令,如上面的回答 – Matteo