I try to install the dependencies from a project I have to maintain, but every time I try to do a composer install I get this error ‘Your requirements could not be resolved to an installable set of packages.‘ and it gives me this error:
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/symfony v3.4.23 -> satisfiable by symfony/symfony[v3.4.23].
- don't install symfony/css-selector v4.2.4|don't install symfony/symfony v3.4.23
- Installation request for symfony/css-selector v4.2.4 -> satisfiable by symfony/css-selector[v4.2.4].
I’ve tried changing composer.json, doing composer update –lock, composer install, composer update
Here I paste the composer.json with the dependencies.
"require": {
"php": ">=7.1",
"ext-json": "*",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-migrations-bundle": "^1.0",
"doctrine/orm": "^2.5",
"incenteev/composer-parameter-handler": "^2.0",
"knplabs/knp-snappy-bundle": "^1.5",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.3.10",
"symfony/symfony": "3.4.*",
"twig/twig": "^1.0||^2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/browser-kit": "^4.2",
"symfony/css-selector": "^4.2",
"symfony/phpunit-bridge": "^4.2"
},
I am unable to start the app beacuse of the autoload.php that comes along with one of the dependencies.
I have the last PHP version and the last composer version.
Thank you very much.
PS: Tried deleting composer.lock and doing again composer install and composer update and this is the result:
Problem 1
- Conclusion: don't install symfony/symfony v3.4.31
- Conclusion: don't install symfony/symfony v3.4.30
- Conclusion: don't install symfony/symfony v3.4.29
- Conclusion: don't install symfony/symfony v3.4.28
- Conclusion: don't install symfony/symfony v3.4.27
- Conclusion: don't install symfony/symfony v3.4.26
- Conclusion: don't install symfony/symfony v3.4.25
- Conclusion: don't install symfony/symfony v3.4.24
- Conclusion: don't install symfony/symfony v3.4.23
- Conclusion: don't install symfony/symfony v3.4.22
- Conclusion: don't install symfony/symfony v3.4.21
- Conclusion: don't install symfony/symfony v3.4.20
- Conclusion: don't install symfony/symfony v3.4.19
- Conclusion: don't install symfony/symfony v3.4.18
- Conclusion: don't install symfony/symfony v3.4.17
- Conclusion: don't install symfony/symfony v3.4.16
- Conclusion: don't install symfony/symfony v3.4.15
- Conclusion: don't install symfony/symfony v3.4.14
- Conclusion: don't install symfony/symfony v3.4.13
- Conclusion: don't install symfony/symfony v3.4.12
- Conclusion: don't install symfony/symfony v3.4.11
- Conclusion: don't install symfony/symfony v3.4.10
- Conclusion: don't install symfony/symfony v3.4.9
- Conclusion: don't install symfony/symfony v3.4.8
- Conclusion: don't install symfony/symfony v3.4.7
- Conclusion: don't install symfony/symfony v3.4.6
- Conclusion: don't install symfony/symfony v3.4.5
- Conclusion: don't install symfony/symfony v3.4.4
- Conclusion: don't install symfony/symfony v3.4.3
- Conclusion: don't install symfony/symfony v3.4.2
- Conclusion: don't install symfony/symfony v3.4.1
- don't install symfony/css-selector v4.2.0|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.1|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.10|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.11|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.2|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.3|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.4|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.5|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.6|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.7|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.8|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.2.9|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.3.0|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.3.1|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.3.2|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.3.3|don't install symfony/symfony v3.4.0
- don't install symfony/css-selector v4.3.4|don't install symfony/symfony v3.4.0
- Installation request for symfony/symfony 3.4.* -> satisfiable by symfony/symfony[v3.4.0, v3.4.1, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.16, v3.4.17, v3.4.18, v3.4.19, v3.4.2, v3.4.20, v3.4.21, v3.4.22, v3.4.23, v3.4.24, v3.4.25, v3.4.26, v3.4.27, v3.4.28, v3.4.29, v3.4.3, v3.4.30, v3.4.31, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9].
- Installation request for symfony/css-selector ^4.2 -> satisfiable by symfony/css-selector[v4.2.0, v4.2.1, v4.2.10, v4.2.11, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.3.0, v4.3.1, v4.3.2, v4.3.3, v4.3.4].
2
Answers
This error means that there is some package incompatibility in your composer.json file. If you want to force, run
composer install --ignore-platform-reqs
But I suggest you to check wich dependencies version are not compatible with each other
I think your problem is caused by combination of these two requirements:
Symfony/symfony package has symfony/css-selector in it’s
replace
section withself.version
That means when composer tries to instalsymfony/symfony
version 3.4.31 it also counts assymfony/css-selector
version 3.4.31 which doesn’t match the version ^4.2 in your require-dev.You might also encouter same problem with
symfony/browser-kit
.You should revise your requirements to not include multiple versions of same package.