Composer "Your requirements could not be resolved" - Fix Dependency Conflicts
Composer’s dependency solver could not find a single set of versions that satisfies every constraint in composer.json at once. Two packages - or a package and your PHP/extension constraints - demand mutually exclusive versions.
What this error means
composer install or composer update runs the solver, then aborts with "Your requirements could not be resolved to an installable set of packages", listing the conflicting constraints. It is deterministic and reproduces locally with the same composer.json.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires symfony/console ^7.0 but it conflicts with
another require.
- laravel/framework v10.0.0 requires symfony/console ^6.2 -> found
symfony/console[v6.2.0, ...] but it conflicts with your root requirement.Common causes
Two packages pin incompatible shared versions
Package A requires symfony/console ^7 while package B requires ^6. No single version satisfies both, so the solver gives up.
An over-tight constraint in your own composer.json
A hard version constraint you added conflicts with what a dependency requires. Loosening it to a compatible caret range often resolves the set.
How to fix it
Read the conflict and align a constraint
- Identify the shared package and the two conflicting constraints in "Problem 1".
- Loosen your own constraint to a range that overlaps both, if one exists.
- If two third-party packages conflict, upgrade the lagging one to a release that accepts the newer shared dependency.
Let Composer explain the conflict in detail
Re-run with full verbosity, or ask why a package is constrained.
composer update -vvv
composer why-not symfony/console 7.0Install from the lockfile in CI
CI should install the already-resolved set rather than re-solving from scratch.
composer install --no-interaction --prefer-distHow to prevent it
- Commit
composer.lockand runcomposer install(notupdate) in CI. - Use caret ranges (
^) rather than hard pins unless a hard pin is genuinely required. - Upgrade related packages together so shared dependencies stay compatible.