Skip to content
Latchkey

npm ETARGET "No matching version found" - Fix Version Resolution

ETARGET means npm could not find any published version of a package matching the range you asked for. The range and the registry’s published versions simply do not overlap.

What this error means

npm install fails with npm error code ETARGET and "No matching version found for <pkg>@<range>". The package exists, but not at a version that satisfies the requested range.

npm output
npm error code ETARGET
npm error notarget No matching version found for left-pad@^9.9.9.
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.

Common causes

The requested range was never published

A typo or an over-eager pin (e.g. ^9.9.9 when the latest is 4.x) targets versions that do not exist on the registry.

A stale or restricted registry view

A mirror that has not synced the latest publish, or a private registry that does not carry the version, can report no matching version even though the public registry has it.

A deleted/unpublished version is still referenced

If a referenced version was unpublished, the range that depended on it can no longer be satisfied.

How to fix it

Check what versions actually exist

List the published versions and adjust the range accordingly.

Terminal
npm view left-pad versions --json
# then set a range that exists, e.g.:
npm install left-pad@^1.3.0

Refresh the registry view

  1. If using a mirror, confirm it has synced the version (or fall back to the canonical registry).
  2. Clear the npm cache if an old metadata view is cached.
  3. Regenerate the lockfile after fixing the range.

How to prevent it

  • Pin to ranges that exist; let tooling propose upgrades.
  • Keep mirrors in sync with the source registry.
  • Commit a lockfile so ranges resolve consistently.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →