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 notice access token expired or revoked. Please try logging in again.
Token has expired - npm authentication failure
npm ERR! code EAI_AGAIN
How to fix "EAI_AGAIN" in npm
npm error code E403 npm error 403 Forbidden - PUT https://registry.npmjs.org/<package>
How to fix 'E403 Forbidden' error in npm
npm ERR! code EUSAGE npm ERR! Usage error
How to fix "npm ERR! code EUSAGE" in Node.js projects
npm ERR! code E401 npm ERR! 401 Unauthorized
How to fix "E401 Unauthorized" in npm