我正在開發一個具有常規依賴關係和一個dev依賴關係的包庫。 Composer recommends to not include the composer.lock
file for libraries,所以這裏是composer.json
爲什麼作曲家安裝--no-dev不起作用?
{
"name": "myself/mypackage",
"require": {
"php": ">=5.6",
"nesbot/carbon": "~1.20"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
}
}
我想這是與運行PHP 5.6的應用程序兼容使用,我想使用最新的PHPUnit的測試工具需要PHP開發它7.
在特拉維斯連續集成測試服務器,我有運行在PHP> 7的PHPUnit測試和掉毛腳本構建矩陣:
composer install
./lint-php.bash
phpunit
和PHP < 7,只需皮棉源代碼:
composer install --no-dev
./lint-php.bash
然而,因爲它忽略了--no-dev
標誌,並嘗試安裝dev的依賴反正它失敗。
Your requirements could not be resolved to an installable set of packages. Problem 1 - phpunit/phpunit 6.0.7 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.6 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.5 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.4 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.3 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.2 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.1 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - phpunit/phpunit 6.0.0 requires php ^7.0 -> your PHP version (5.6.5) does not satisfy that requirement. - Installation request for phpunit/phpunit ^6.0 -> satisfiable by phpunit/phpunit[6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7].
爲什麼無視--no-dev
標誌?我只想要它安裝我的常規依賴關係,並忽略require-dev
部分。