How to fix "Your requirements could not be resolved to an installable set of packages"
A step-by-step way to read Composer's conflict output, find the package that is blocking you, and fix it without --ignore-platform-reqs or deleting the lock file.
On this page
Composer prints this when no combination of versions satisfies every constraint at once. The message looks intimidating, but it always comes down to one of four causes, and Composer’s own output tells you which.
Read the output from the top
A typical failure:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires acme/report-builder ^3.0 -> satisfiable by acme/report-builder[3.0.0, 3.1.0].
- acme/report-builder[3.0.0, ..., 3.1.0] require symfony/console ^7.0 -> found symfony/console[v7.0.0, ...] but the package is fixed to v6.4.12 (lock file version) by a partial update and that version does not match.
Read each Problem as a chain: you require A; A requires B at version X; but B is stuck at Y because of Z. The last line of the chain is the real blocker. In this example symfony/console is pinned by the lock file and you asked to update only one package.
Cause 1: a partial update pinned by the lock file
If the message says “fixed to … (lock file version) by a partial update”, let Composer move the dependencies too:
composer update acme/report-builder --with-dependencies
# or, if a dependency is also required directly in composer.json:
composer update acme/report-builder --with-all-dependencies
Cause 2: two packages want incompatible versions of a third
- package-a 2.x requires psr/log ^1.0
- package-b 5.x requires psr/log ^3.0
Ask Composer why each version is required, and why the one you want is not allowed:
composer why psr/log
composer why-not psr/log 3.0
Then fix it at the source: upgrade package-a to a release that supports the newer version, pin package-b to an older major that still matches, or replace one of them. There is no flag that makes two incompatible packages work together.
Cause 3: the PHP version or an extension
- acme/report-builder 3.1.0 requires php >=8.3 -> your php version (8.2.27) does not satisfy that requirement.
- ... requires ext-intl * -> it is missing from your system.
Composer checks the PHP that runs Composer, or the version in config.platform.php if you set one. See why Composer reports the wrong PHP version if the version shown is not the one your server uses. For a missing extension, install it (apt install php8.3-intl, docker-php-ext-install intl) rather than ignoring it.
Cause 4: minimum stability
- ... found acme/report-builder[dev-main, 4.0.0-beta2] but it does not match your minimum-stability.
Only stable releases are allowed by default. Either wait for a stable tag, or allow this one package to be a beta with a stability flag: "acme/report-builder": "^4.0@beta". The constraint tester shows how flags change what matches.
Things not to do
--ignore-platform-reqsinstalls packages that may not run on your PHP. Use it only to install tools in a throwaway container.- Deleting
composer.lockandvendor/turns one conflict into an upgrade of every package at once. You lose the record of what was tested. "*"constraints make conflicts rarer today and upgrades unpredictable tomorrow.
A quick routine
- Run the failing command again with
-W(--with-all-dependencies). - Read the last line of each Problem chain.
- Run
composer why-not <package> <version>. - Change one constraint, then repeat.