Skip to content

[BUG] NPM Login Failure Blocking Package Installation #8875

@bobbybeers

Description

@bobbybeers

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

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

  1. Package install returns E401 - Incorrect or missing password
  2. npm login fails with:
npm error Exit handler never called!
npm error This is an error with npm itself.
  1. 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

  1. Run npm login against a private registry using browser-based SSO authentication
  2. Press ENTER when prompted to open browser
  3. Observe "Exit handler never called!" error before browser auth can complete
  4. Attempt to install a package from the private registry
  5. Receive E401 - Incorrect or missing password error

Environment

  • npm: 10.8.2
  • Node.js: v20.18.3
  • OS: macOS 26.1
  • System: Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions