Composer cannot find a version that matches your minimum-stability
Could not find a version of package vendor/package matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.Short answer
The package exists, but every release Composer can see is less stable than your minimum-stability setting, which is stable unless you changed it. Composer only raises this when you run require without a version. Give an explicit constraint with a stability flag, such as ^2.0@beta, or lower minimum-stability for the whole project.
Fix it fast
1Find out which cause you have
List the versions Composer can see for the package and note what they are called: plain numbers are stable, names with alpha, beta or RC are pre-releases, and names starting with dev- are branches. Then read your project's own stability setting.
composer show vendor/package grep -n -E "minimum-stability|prefer-stable" composer.json2Match what you see, then jump to its fix
- 1
composer show lists versions such as 2.0.0-beta.3 and no plain 2.x releaseThe package has only pre-release versions (alpha, beta or RC)Fix - 2
composer show lists only names like dev-main or dev-masterThe package has only branches and no tagged releaseFix - 3
The same error repeats for several packages in a row, and composer.json has no minimum-stability line or sets it to stableThe whole project needs pre-releases but its floor is still stableFix
- 1
What does the error look like?
Could not find a version of package vendor/package matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.Could not find a version of package vendor/package matching your minimum-stability (RC). Require it with an explicit version constraint allowing its desired stability.
Cause 1 of 3
The package has only pre-release versions (alpha, beta or RC)
1Check
Composer ranks stability as dev, alpha, beta, RC, stable. With the default floor of stable, every pre-release is dropped from resolution, so a require with no version finds nothing it may install.
composer show vendor/package2Fix
Name the version yourself and add a stability flag to it. The flag lets this one package be a beta while the rest of the project stays at stable.
composer require "vendor/package:^2.0@beta"3Verify
composer.json now holds the constraint, and the package is installed.
grep -n "vendor/package" composer.json
composer show vendor/packageConfirmed by getcomposer.org
Cause 2 of 3
The package has only branches and no tagged release
1Check
A repository that never tagged a release offers branches only. Composer reads a branch as a version named dev- plus the branch name, and dev is the lowest stability.
composer show vendor/package2Fix
Require the branch with the dev- prefix. Use the branch name your repository really has, and add the @dev flag to say you accept that stability. For a private Git repository, it must also be declared under repositories in composer.json.
composer require "vendor/package:dev-main@dev"3Verify
composer.json now records the constraint, and composer show lists the package as installed.
grep -n "vendor/package" composer.jsonConfirmed by getcomposer.org
Cause 3 of 3
The whole project needs pre-releases but its floor is still stable
1Check
minimum-stability is a root-only setting. It defaults to stable and removes every less stable version from dependency resolution, for all packages, not just the one you named.
grep -n -E "minimum-stability|prefer-stable" composer.json2Fix
Lower the floor to the least stable level you accept and turn on prefer-stable. Composer then picks stable releases whenever a compatible one exists and falls back to a pre-release only when it has to.
{
"minimum-stability": "beta",
"prefer-stable": true
}3Verify
Run the require again without a version.
composer require vendor/packageConfirmed by getcomposer.org
How do I stop it coming back?
- Give every package an explicit constraint in composer.json instead of relying on require to choose one.
- Keep minimum-stability at stable for production projects, and use per-package flags for the rare pre-release.
- When you do lower minimum-stability, set prefer-stable to true in the same edit.
- Ask library authors to tag releases, so users do not have to depend on a branch name.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Composer says a package could not be found in any version
The requested package ... could not be found in any version
Composer can only install what its repositories list at a stability it allows.
4 causes, each with a fixBack end
Android gets HTML instead of JSON from a PHP API
org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
The response body is not JSON.
2 causes, each with a fixBack end
Apache returns 403 when a URL contains %3F
a request like /page%3Fname=test is refused while /page?name=test works
Recent Apache httpd blocks a rewrite when the request contains an encoded question mark (%3F) and the rewritten target has a literal ?.
2 causes, each with a fixBack end
Apache returns 500 with Premature end of script headers
500 Internal Server Error
Apache ran your script, but the script printed no valid HTTP header before its output.
3 causes, each with a fixBack end
Apache returns 503 or 504 because PHP-FPM did not answer in time
Error dispatching request
Apache sent the request to PHP-FPM and gave up waiting.
3 causes, each with a fixBack end
AWS SDK for PHP cannot get credentials from the instance profile metadata server
Error retrieving credentials from the instance profile metadata server.
The SDK tries the EC2 instance metadata service when it has no valid credentials from anywhere earlier in its chain.
4 causes, each with a fix