Skip to content

[BUG] login does not work without a browser #8575

Closed

Description

@aredridel

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

:; npm login
npm notice Log in on https://registry.npmjs.org/
Login at:
https://www.npmjs.com/login?next=/login/cli/***
Press ENTER to open in the browser...

Browser unavailable. Please open the URL manually:
https://www.npmjs.com/login?next=/login/cli/***

the URL is censored in both cases, which makes it useless.

Expected Behavior

Login prints the URL so I can open it, and gives me a place to enter a code or uses device flow behind the scenes.

Steps To Reproduce

  1. In this environment... A remote ubuntu session, connected via SSH
  2. With this config... Defaults
  3. Run npm login
  4. See censored URL.

Environment

  • npm:
  • Node.js:
  • OS Name:
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here

Activity

  1. iarna commented on Sep 17, 2025

    @iarna
    Contributor

    This bug was introduced with #8529

    Interactive console output should not be redacted, IMO. Log file output, yes. Console output, especially in interactive commands like login, never. If someone chooses to call something like this and log the console output, they've really made their own bed.

    While you're there, lib/commands/login should probably not be passing interactive user output through @npm/redact -- something that's been harmless but there's no reason to imagine it would remain that way forever.

  2. internettrans commented on Sep 22, 2025

    @internettrans
    Contributor

    This also breaks the npm publish behavior for me, due to hardware security key authentication printing URLs to the console that are now redacted and not functional.

  3. Glavin001 commented on Oct 23, 2025

    @Glavin001

    Is there a workaround for this issue? I appear to be blocked from logging in to npm.

    $ node --version
    v24.9.0
    $ npm --version
    11.6.0
    

    Update:

    Workaround: Downgrade

    $ nvm install --lts && nvm use --lts
    
    $ node --version
    v22.21.0
    $ npm --version
    10.9.4
  4. internettrans commented on Oct 24, 2025

    @internettrans
    Contributor

    My pull request fixing this was superseded by #8614 and released in npm@11.6.2. I think it's fixed in 11.6.2 but haven't tried it yet

  5. aredridel commented on Oct 24, 2025

    @aredridel
    ContributorAuthor

    Can confirm, fixed in 11.6.2.

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

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