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 error code ENOVERSIONS
npm error No versions available for ghost-pkgCommon 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.
npm view ghost-pkg versions --registry https://registry.npmjs.org/ --json
# if the mirror is empty but the source has versions, switch registriesReplace or re-point the dependency
- If the package was unpublished, switch to a maintained alternative or a fork.
- If a mirror is broken, re-sync it or point at the canonical registry.
- 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.