Answer the question
In order to leave comments, you need to log in
How to resolve dev dependencies in composer?
There are three internal repositories: core and two dependencies AAA and BBB.
company/core composer.json:
{
"name": "company/core",
"require": {
"company/aaa": "1.9.3",
"company/bbb": "1.4.0"
},
"config": {
"discard-changes": true
},
"autoload": { ... },
"repositories": [ ... ]
}
{
"name": "company/aaa",
"minimum-stability": "dev",
"require": { ... },
"autoload": { ... }
}
{
"name": "company/bbb",
"prefer-stable": true,
"require": {
"company/aaa": ">=1.8.0"
},
"autoload": { ... },
"repositories": { ... }
}
$ composer require "company/aaa:dev-my_branch_name"
./composer.json has been updated
Running composer update company/aaa
Loading composer repositories with package information Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- company/bbb is locked to version v1.4.0 and an update of this package was not requested.
- company/bbb v1.4.0 requires company/aaa >=1.8.0 -> found company/aaa[dev-master, v1.8.0, ..., v1.9.6] but it conflicts with your root composer.json require (dev-my_branch_name).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
-W
doesn't help. Tell me what you need to explain to the composer in order to do what you have planned? We can change all three composer files.
Answer the question
In order to leave comments, you need to log in
What about this crutch:
composer require "company/aaa:dev-my_branch_name as 1.8.1"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question