Skip to content
Latchkey

npm ENOVERSIONS "No valid versions available" - Fix Empty Package Metadata

ENOVERSIONS means npm fetched a package’s metadata but found zero published versions to choose from. The package document exists, yet its versions map is empty.

What this error means

npm install fails with npm error code ENOVERSIONS and "No versions available" for a package. Unlike ETARGET (a range with no match), here there are no versions at all to match against.

npm output
npm error code ENOVERSIONS
npm error No versions available for ghost-pkg

Common causes

The package was fully unpublished

If every version of a package was unpublished, its registry document remains but lists no versions, so npm has nothing to install.

A broken or partially synced mirror

A mirror that served an empty or truncated metadata document reports no versions even though the canonical registry has them.

How to fix it

Check the package on the canonical registry

Confirm whether any versions actually exist, and fall back to the source registry if a mirror is broken.

Terminal
npm view ghost-pkg versions --registry https://registry.npmjs.org/ --json
# if the mirror is empty but the source has versions, switch registries

Replace or re-point the dependency

  1. If the package was unpublished, switch to a maintained alternative or a fork.
  2. If a mirror is broken, re-sync it or point at the canonical registry.
  3. Regenerate the lockfile after changing the dependency or registry.

How to prevent it

  • Avoid depending on packages with a history of being unpublished.
  • Keep mirrors fully synced with the source registry.
  • Vendor or mirror critical dependencies you cannot afford to lose.

Related guides

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