Composer "Could not find package" - Fix Unknown Packages in CI
Composer searched the configured repositories and found nothing matching the package name or constraint you asked for. Usually a typo, a private package without its repository configured, or a stability constraint that excludes every release.
What this error means
Composer aborts saying it could not find the package, or could not find a matching version. It often hints that the package exists but no version matches your minimum-stability, or that the name may be spelled wrong.
[InvalidArgumentException]
Could not find a matching version of package acme/widgets. Check the package
spelling, your version constraint and that the package is available in a
stability which matches your minimum-stability (stable).Common causes
Misspelled package or wrong vendor
The vendor/name differs from what you typed, or the package was renamed. Composer has nothing to match against.
A private package without its repository configured
Internal packages are not on Packagist. Without a repositories entry pointing at your VCS or private Composer registry, Composer cannot see them.
minimum-stability excludes every release
The package only has dev/alpha releases, but your minimum-stability is stable, so no version qualifies.
How to fix it
Verify the exact name and available versions
composer show acme/widgets --all
composer search acme/widgetsRegister the private repository
Add the source so Composer can resolve internal packages.
{
"repositories": [
{ "type": "vcs", "url": "https://github.com/acme/widgets" }
],
"minimum-stability": "dev",
"prefer-stable": true
}Adjust stability when only pre-releases exist
Lower minimum-stability (with prefer-stable) or pin an explicit pre-release constraint like dev-main.
How to prevent it
- Configure private registries/VCS repositories in
composer.json, not ad hoc. - Keep
minimum-stabilitystrict and pin individual pre-releases when needed. - Copy package names from Packagist to avoid vendor/name typos.