# npm ERR! code ENEEDAUTH — need auth This command requires you to be logged in

**Code:** `ENEEDAUTH` · **Category:** npm · **Seen on:** npm

npm needs credentials (publishing, private packages) but none are configured for that registry.

## 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

1. npm login --registry <url>
2. Add the token to .npmrc for the scope
3. Set NPM_TOKEN in CI secrets

## Detailed fix by platform

### npm

1. `npm whoami --registry https://registry.npmjs.org/`

## How to diagnose

1. **Registry** — Which registry needs auth?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/npm/eneedauth)
