The version not published error occurs when you try to install a package version that doesn't exist in the npm registry. Verify the version exists, check for typos, or clear your npm cache if the version was recently published.
This error occurs when npm cannot find the specific version of a package you're trying to install. The package might exist, but the particular version you requested isn't available in the registry. Common scenarios include: requesting a version that was unpublished (npm allows unpublishing within 72 hours of initial publish), typos in version numbers, or trying to install a version that was never actually released. The error can also appear when npm's cache is stale and doesn't reflect recent registry changes, or when accessing private packages without proper authentication.
Check what versions are actually available:
npm view <package-name> versionsThis shows all published versions. If your requested version isn't listed, it doesn't exist.
Common version typos:
- 1.0 instead of 1.0.0
- v1.0.0 instead of 1.0.0
- Wrong minor/patch number
Fix in package.json:
{
"dependencies": {
"package": "1.0.0"
}
}If the version was recently published, clear your cache:
npm cache clean --force
npm installnpm caches package metadata, which might be stale.
If you don't need an exact version, use a range:
{
"dependencies": {
"package": "^1.0.0"
}
}This installs the latest 1.x.x version that exists.
For scoped or private packages, ensure you're logged in:
npm whoami
npm loginFor organizations, verify your access:
npm access ls-packagesIf you just published the version, wait a few minutes. npm's CDN can take time to sync.
Check the registry directly:
npm view <package-name>@<version>If it returns data, the version exists and your cache is stale.
npm's unpublish policy allows package owners to remove versions within 72 hours of publishing. After that, unpublishing requires contacting npm support. If a critical version disappears, check with the package maintainer or look for alternatives.
For enterprise environments with private registries (Verdaccio, Nexus, Artifactory), this error might indicate the version wasn't synced from the upstream registry. Check your registry's proxy/cache settings.
In CI/CD pipelines, use npm ci with a committed package-lock.json to ensure reproducible builds. This prevents issues where a version is available during development but later becomes unavailable.
If you're the package maintainer and accidentally unpublished, you can republish the same version within 24 hours. After that, you must increment the version number.
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name: tag names cannot contain spaces
How to fix "npm ERR! code EINVALIDTAGNAME - tag names cannot contain spaces"
npm ERR! code E400 npm ERR! 400 Bad Request
How to fix "npm ERR! code E400 - 400 Bad Request" error