pnpm ERR_PNPM_NO_MATCHING_VERSION in CI - Fix Unresolvable Version Range
ERR_PNPM_NO_MATCHING_VERSION means pnpm asked the registry for a version range and got no version that satisfies it. The range, the package name, or the registry is wrong.
What this error means
pnpm install fails with ERR_PNPM_NO_MATCHING_VERSION, listing the package and the requested range alongside the versions that are actually available.
pnpm
ERR_PNPM_NO_MATCHING_VERSION No matching version found for left-pad@^99.0.0
The latest release of left-pad is "1.3.0".
Other releases are: 1.2.0, 1.1.3, ...Common causes
The requested range does not exist
A typo or an over-eager bump asks for a version that was never published.
The wrong registry is being queried
A scoped package is resolved against the public registry instead of the private one that hosts the requested version.
How to fix it
Correct the version range
- Check published versions with pnpm view <pkg> versions.
- Set a range that actually exists and reinstall.
Terminal
pnpm view left-pad versionsMap the package to the right registry
- For a scoped package, add the scope-to-registry mapping in .npmrc.
- Reinstall so pnpm queries the registry that has the version.
.npmrc
@acme:registry=https://registry.acme.internal/How to prevent it
- Pin versions that exist, configure scoped-registry mappings in .npmrc, and let renovate or dependabot bump ranges so they always point at published versions.
Related guides
pnpm ERR_PNPM_NO_MATCHING_VERSION "No matching version found" - Fix in CIFix pnpm ERR_PNPM_NO_MATCHING_VERSION "No matching version found for <pkg>@<range>" in CI - a range no publis…
npm ETARGET "No matching version found" - Fix Version ResolutionFix npm ETARGET "No matching version found for pkg@range" in CI - a version range that no published release s…
Scoped Package 404 (Missing Registry Mapping) in CI - Fix Scope ResolutionFix scoped package 404 errors in CI by mapping the scope to its private registry in .npmrc, since the default…