How to fix npm ERR! code E404 npm ERR! 404 Not Found - DELETE https://registry.npmjs.org/package/-/package-version.tgz in npm

npmINTERMEDIATEMEDIUMUpdated Dec 5, 2025· 133 views

This error occurs when attempting to unpublish a package version that doesn't exist in the npm registry, or when authentication/permissions prevent the registry from finding or deleting the specified version.

Quick fix

Fixes npm ERR! code E404 npm ERR! 404 Not Found - DELETE https://registry.npmjs.org/package/-/package-version.tgz

npm unpublish <package>@<version> --loglevel verbose
  1. Enable verbose logging to see actual error
  2. Confirm the version exists in the registry
  3. Verify package name spelling and format
  4. Refresh authentication credentials
npm — error
npm unpublish <package>@<version> --loglevel verbose
npm ERR! code E404
npm ERR! 404 Not Found - DELETE https://registry.npmjs.org/package/-/package-version.tgz

What this error means

This error occurs when attempting to unpublish a package version that doesn't exist in the npm registry, or when authentication/permissions prevent the registry from finding or deleting the specified version. The 404 (Not Found) response indicates the DELETE request failed because the server couldn't locate the package version. This can stem from authentication issues, incorrect registry configuration, or the version having already been unpublished. Important: The E404 error often masks authentication problems. The npm CLI frequently returns 404 errors instead of 401/403 auth errors, which is why verbose logging is critical for debugging.

Typical symptoms

  • npm unpublish command fails with 'E404' error code
  • Error message shows 'DELETE' HTTP method when unpublishing
  • Cannot unpublish a version that was already unpublished
  • Unpublish fails but works for some package versions
  • Registry returns 404 when checking package permissions

Common causes

  1. Package version was already unpublished or deleted previously
  2. Authentication token is missing, expired, or lacks write permissions
  3. Package is pointing to the wrong registry (private vs. public npm)
  4. Package name contains typos or incorrect capitalization
  5. Scoped package permissions not set to read/write
  6. 2FA enabled on npm account but CLI token not updated

How to fix "npm ERR! code E404 npm ERR! 404 Not Found - DELETE https://registry.npmjs.org/package/-/package-version.tgz"

1Enable verbose logging to see actual error

Run the unpublish command with verbose logging to reveal the true error:

bash
npm unpublish <package>@<version> --loglevel verbose

Read the full output to determine if this is actually an authentication (401/403) issue disguised as 404.

2Confirm the version exists in the registry

Check that the specific version you're trying to unpublish actually exists:

bash
npm view <package> versions

If the version is not listed, it was already unpublished or never published. Remember: once unpublished, a version can never be reused.

3Verify package name spelling and format

Check that the package name:
- Uses only lowercase letters (npm rejects uppercase)
- Has correct spelling without typos
- For scoped packages, uses format @scope/package-name

Example checking a package:

bash
npm view @my-org/my-package version
4Refresh authentication credentials

The 404 error often masks authentication problems. Clear your npm login and re-authenticate:

bash
npm logout
npm login

Enter your npm username and password when prompted. This generates a fresh authentication token.

5Check unpublish time window and policy

Review npm's unpublish policy:

- Within 72 hours: You can unpublish any version
- After 72 hours: You can only unpublish if package has no dependents
- Alternative: Use npm deprecate <package>@<version> '<message>' instead

If your package doesn't meet the policy, contact support@npmjs.com.

6Verify registry configuration

Ensure npm is configured to use the correct registry:

bash
npm config get registry

Should return https://registry.npmjs.org/ (or your private registry URL).

For scoped packages, verify write access:

bash
npm access ls-collaborators <@scope/package>

Advanced notes

404 masking auth errors: The npm registry frequently returns 404 errors instead of proper 401/403 authentication errors. Always run with --loglevel verbose first.

Verdaccio users: If using Verdaccio (private npm), check the package's JSON file in .verdaccio/storage/ for an 'unpublished' node that may need manual removal.

24-hour cooldown: The npm registry has a 24-hour cooldown after unpublishing an entire package before new versions can be published under that name.

Version immutability: Once a name@version combination is unpublished, it can never be reused—only a new version number is valid.

Frequently asked questions

What does "npm ERR! code E404 npm ERR! 404 Not Found - DELETE https://registry.np" mean?
This error occurs when attempting to unpublish a package version that doesn't exist in the npm registry, or when authentication/permissions prevent the registry from finding or deleting the specified version. The 404 (Not Found) response indicates the DELETE request failed because the server couldn't locate the package version. This can stem from authentication issues, incorrect registry configuration, or the version having already been unpublished.
How do I fix "npm ERR! code E404 npm ERR! 404 Not Found - DELETE https://registry.np"?
This error occurs when attempting to unpublish a package version that doesn't exist in the npm registry, or when authentication/permissions prevent the registry from finding or deleting the specified version.
What causes "npm ERR! code E404 npm ERR! 404 Not Found - DELETE https://registry.np"?
Package version was already unpublished or deleted previously Authentication token is missing, expired, or lacks write permissions Package is pointing to the wrong registry (private vs. public npm)
Is the "npm ERR! code E404 npm ERR! 404 Not Found - DELETE https://registry.np" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading