Closed weirdan closed 3 years ago
Composer 2 gives you a better explanation of why it's not working:
Problem 1
- ocramius/package-versions is locked to version 1.9.0 and an update of this package was not requested.
- composer/package-versions-deprecated[1.11.99] cannot be installed as that would require removing ocramius/package-versions[1.9.0]. composer/package-versions-deprecated replaces ocramius/package-versions and thus cannot coexist with it.
- Root composer.json requires composer/package-versions-deprecated ^1.11 -> satisfiable by composer/package-versions-deprecated[1.11.99].
Use the option --with-all-dependencies to allow upgrades, downgrades and removals for packages currently locked to specific versions.
And indeed...
$ composer require composer/package-versions-deprecated --with-all-dependencies
Using version ^1.11 for composer/package-versions-deprecated
./composer.json has been updated
Running composer update composer/package-versions-deprecated --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 1 removal
- Removing ocramius/package-versions (1.9.0)
- Locking composer/package-versions-deprecated (1.11.99)
Writing lock file
Just requiring a package does not allow updating others, so it fails to apply the removal of the original package.
Repro repo
https://github.com/weirdan/cannot-replace-packageversions
Steps to reproduce
Expected
composer/package-versions-deprecated
replacesocramius/package-versions
Actual
Installation fails with the following errors:
Likely cause
I believe it's caused by this change: https://github.com/composer/package-versions-deprecated/commit/97f2c999fb7398ae25755ec63fe092521f0b0b7b