npm ERR! code ENEEDAUTH — need auth This command requires you to be logged in
npm needs credentials (publishing, private packages) but none are configured for that registry.
Seen on:
npm
Meaning
Log in for the right registry/scope, or provide a token in .npmrc.
Common causes
- Not logged in
- Logged in to a different registry
- CI without NPM_TOKEN
⚡ Quick fix
- npm login --registry <url>
- Add the token to .npmrc for the scope
- Set NPM_TOKEN in CI secrets
Detailed fix by platform
npm
npm whoami --registry https://registry.npmjs.org/
How to diagnose
- Registry — Which registry needs auth?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026