Skip to content

/errors/composer/requirements-could-not-be-resolved

Composer: Your requirements could not be resolved to an installable set of packages.

The commands on this page have not been executed by our verification runner yet.updated
tool
Composer
exit code
2
versions
Composer 2.x
os
any

Your requirements could not be resolved to an installable set of packages. means Composer's solver found no combination of package versions that satisfies every constraint in composer.json (and in the lock file, for composer install). The real reason is in the Problem 1, Problem 2 blocks that follow. Most often it is the PHP version or a missing extension (Root composer.json requires php ^8.2 but your php version (8.1.x) does not satisfy that requirement), or two packages wanting different versions of the same library.

Read the problem lines

Each problem is a short chain: the root requirement, then the package versions Composer tried and why each was rejected. Look for these patterns:

Line containsMeaningFix
requires php ^8.2 but your php version (8.1.x) does not satisfy that requirementWrong PHP for this lock or packageUse the right PHP, or set config.platform.php
requires ext-intl * -> it is missing from your systemA PHP extension is not enabledInstall or enable the extension for the PHP CLI
found vendor/pkg[1.0.0, ..., 1.4.2] but it does not match the constraintNo release matches the constraintChange the constraint
but these were not loaded, likely because it conflicts with another requireTwo requirements conflictUse why-not, then -W or adjust constraints
could not be found in any versionTypo, private package, or minimum-stabilityCheck the name, repositories and stability

Diagnose and fix

bash
composer why-not laravel/framework 11.0     # what blocks this version?
composer why symfony/console                # who requires this package?
composer require vendor/package:^3.0 -W     # allow its dependencies to change too
composer update -W                          # update everything that needs to move
composer check-platform-reqs                # PHP and extensions the lock file needs

Match production PHP

If developers run a newer PHP than production, pin the platform so Composer resolves for the production version:

composer.json
{
  "config": {
    "platform": {
      "php": "8.2.0"
    }
  }
}

Sources