Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Incident: NPM Login Failure Blocking Package Installation
Summary
Unable to install packages from private registry due to npm login failing with "Exit handler never called!" error.
Severity
High - Blocks package installation and updates
Symptoms
- Package install returns
E401 - Incorrect or missing password
npm login fails with:
npm error Exit handler never called!
npm error This is an error with npm itself.
- Browser-based auth flow never completes
Root Cause
Known npm CLI bug where exit handler fails during SSO/browser-based authentication with private registries. Auth token is never saved to .npmrc.
Workaround
Manually generate access token via registry web UI and add to .npmrc:
Expected Behavior
Running npm login should open a browser window, complete SSO authentication, and save the auth token to .npmrc, allowing subsequent package installations to succeed.
Steps To Reproduce
- Run
npm login against a private registry using browser-based SSO authentication
- Press ENTER when prompted to open browser
- Observe "Exit handler never called!" error before browser auth can complete
- Attempt to install a package from the private registry
- Receive
E401 - Incorrect or missing password error
Environment
- npm: 10.8.2
- Node.js: v20.18.3
- OS: macOS 26.1
- System: Mac
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Incident: NPM Login Failure Blocking Package Installation
Summary
Unable to install packages from private registry due to
npm loginfailing with "Exit handler never called!" error.Severity
High - Blocks package installation and updates
Symptoms
E401 - Incorrect or missing passwordnpm loginfails with:Root Cause
Known npm CLI bug where exit handler fails during SSO/browser-based authentication with private registries. Auth token is never saved to
.npmrc.Workaround
Manually generate access token via registry web UI and add to
.npmrc:Expected Behavior
Running
npm loginshould open a browser window, complete SSO authentication, and save the auth token to.npmrc, allowing subsequent package installations to succeed.Steps To Reproduce
npm loginagainst a private registry using browser-based SSO authenticationE401 - Incorrect or missing passworderrorEnvironment