Skip to content

feat(auth): open the browser immediately instead of waiting for ENTER during login#9711

Open
styfle wants to merge 1 commit into
npm:latestfrom
styfle:styfle/npm-login-no-prompt
Open

feat(auth): open the browser immediately instead of waiting for ENTER during login#9711
styfle wants to merge 1 commit into
npm:latestfrom
styfle:styfle/npm-login-no-prompt

Conversation

@styfle

@styfle styfle commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Starting December 2025, running npm login issues a short-lived "session token" that permanently expires after two hours.

Each time it requires you to do all of the following

  1. Run npm login
  2. Push ENTER which opens the browser
  3. Click the login button on the website
  4. Use passkey or otherwise
  5. Switch back to terminal

References

My own pain

Solution

Remove step 2 so the user doesn't need to push ENTER anymore and removes this annoying prompt:

Press ENTER to open in the browser...

@styfle styfle requested review from a team as code owners July 2, 2026 17:35
Comment thread lib/utils/open-url.js

// Prompt to open URL in browser if possible
const openUrlPrompt = async (npm, url, title, prompt, { signal }) => {
// Print the url and open it in the browser if the environment is interactive

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Print the url and open it in the browser if the environment is interactive
// Print the URL and open it in the browser if the environment is interactive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants