Giter Club home page Giter Club logo

Comments (9)

bkuhlmann avatar bkuhlmann commented on August 16, 2024 1

Huh, sure enough, ensuring that --progress=true is used made this work! ...but if I disable progress then, yes, the login fails.

from cli.

kchindam-infy avatar kchindam-infy commented on August 16, 2024

HI @DanielLey21
To better understand the issue, could you please provide your npm config details. Please make sure to mask any sensitive information. you can replace sensitive information by [MASKED] or ***.

This will help to reproduce the issue and investigate further.

from cli.

bkuhlmann avatar bkuhlmann commented on August 16, 2024

Hi. 👋 In case it helps, I've been running into this too. Here's my details:

Configuration

init-author-name=Brooke Kuhlmann
init-license=Hippocratic-2.1
progress=false
save-prefix=~
//registry.npmjs.org/:_authToken=<redacted>

System

  • OS: macOS 14.5
  • Node: 22.4.1
  • Browser: Firefox

The workaround I've found is not to hit ENTER when problem occurs but, instead, copy the URL and paste it directly into your browser. This seems to complete authentication properly. ...but if you do hit enter, you'll always get the error reported above.

from cli.

kchindam-infy avatar kchindam-infy commented on August 16, 2024

@bkuhlmann Thanks for the npm config, ofcourse i have tried with similar config with npm registry and authToken. On npm login command on Press Enter key it successfully launched the npmjs browser with login page as expected. Please check your config registry and try again.

Tried on:
OS: macOS 14.5
Node 20 and 22

from cli.

bkuhlmann avatar bkuhlmann commented on August 16, 2024

Thanks. OK, I think I've got better Steps to Recreate for you. Try this:

Initial Configuration

init-author-name="Brooke Kuhlmann"
init-license="Hippocratic-2.1"
progress=false
save-prefix="~"

Steps

Notice I've made sure the registry is deleted this time. Now attempt to login via npm login. Here's what I see:

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

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error   <https://github.com/npm/cli/issues>
npm error A complete log of this run can be found in: /Users/bkuhlmann/.npm/_logs/2024-07-13T17_26_46_989Z-debug-0.log

Here's the full log:

Log Details
File: /Users/bkuhlmann/.npm/_logs/2024-07-13T17_26_46_989Z-debug-0.log

0 verbose cli /Users/bkuhlmann/.cache/fnm/node-versions/v22.4.1/installation/bin/node /Users/bkuhlmann/.local/state/fnm_multishells/1153_1720632845221/bin/npm
1 info using [email protected]
2 info using [email protected]
3 silly config load:file:/Users/bkuhlmann/.cache/fnm/node-versions/v22.4.1/installation/lib/node_modules/npm/npmrc
4 silly config load:file:/Users/bkuhlmann/Engineering/OSS/dotfiles/.npmrc
5 silly config load:file:/Users/bkuhlmann/.npmrc
6 silly config load:file:/Users/bkuhlmann/.cache/fnm/node-versions/v22.4.1/installation/etc/npmrc
7 verbose title npm login
8 verbose argv "login"
9 verbose logfile logs-max:10 dir:/Users/bkuhlmann/.npm/_logs/2024-07-13T17_26_46_989Z-
10 verbose logfile /Users/bkuhlmann/.npm/_logs/2024-07-13T17_26_46_989Z-debug-0.log
11 notice Log in on https://registry.npmjs.org/
12 verbose web login before first POST
13 silly logfile start cleaning logs, removing 1 files
14 silly logfile done cleaning log files
15 http fetch POST 200 https://registry.npmjs.org/-/v1/login 1879ms
16 verbose web auth got response {
16 verbose web auth   loginUrl: 'https://www.npmjs.com/login?next=/login/cli/<redacted>',
16 verbose web auth   doneUrl: 'https://registry.npmjs.org/-/v1/done?sessionId=<redacted>'
16 verbose web auth }
17 verbose web auth opening url pair
18 http fetch GET 202 https://registry.npmjs.org/-/v1/done?sessionId=*** 207ms
19 verbose cwd /Users/bkuhlmann/Engineering/OSS/dotfiles
20 verbose os Darwin 23.5.0
21 verbose node v22.4.1
22 verbose npm  v10.8.1
23 error Exit handler never called!
24 error This is an error with npm itself. Please report this error at:
25 error   <https://github.com/npm/cli/issues>
26 verbose exit 0
27 info ok
28 error A complete log of this run can be found in: /Users/bkuhlmann/.npm/_logs/2024-07-13T17_26_46_989Z-debug-0.log

So the above errors and I don't see //registry.npmjs.org/:_authToken=<redacted> written to my .npmrc file. However, if I click on the URL instead of hitting ENTER. This works!

By the way, in case this helps, I'm using my YubiKey to authenticate. Maybe there is some kind of delay the CLI fails to deal with that directly clicking the URL handles better?

from cli.

milaninfy avatar milaninfy commented on August 16, 2024

Similer issues where we have the url opener for web auth. Tracking these here in this issue.

  • #7644
    • npm: 10.8.2
    • Node.js: v20.13.1
    • OS Name: Windows_NT 10.0.22631
  • #7642
    • npm: 10.8.2
    • Node.js: v22.4.1
    • OS Name: Darwin Kernel Version 23.5.0: Wed May 1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64
  • #7651

from cli.

milaninfy avatar milaninfy commented on August 16, 2024

manage to reproduce similer behaviour

  1. Run npm login --no-progress
  2. Hit Enter
  3. It will open the browser but also it will error out in terminal
~/workarea/rep $ npm login --no-progress
npm notice Log in on https://registry.npmjs.org/
Login at:
https://www.npmjs.com/login?next=/login/cli/3226b795-9794-4937-b58d-3d9820fa93e4
Press ENTER to open in the browser...

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error   <https://github.com/npm/cli/issues>
npm error A complete log of this run can be found in: /Users/milaninfy/.npm/_logs/2024-07-23T15_34_01_010Z-debug-0.log

from cli.

milaninfy avatar milaninfy commented on August 16, 2024

@bkuhlmann I see in your reproduction steps that you have one config progress=false. Could you please try without that config (i.e. something like npm login --progress=true) and see if that fixes your issue ?

from cli.

Tomtom-Skywalker avatar Tomtom-Skywalker commented on August 16, 2024

i also have same issue, and this is my first time using npm login so i do not have a npmrc file and my first time reporting a bug on github so if ive done anythign wrong ill try to improve on it
npm: '10.8.2',
node: '22.6.0',

$ npm login
npm notice Log in on https://registry.npmjs.org/
Login at:
https://www.npmjs.com/login?next=/login/cli/Fancy_String_Of_Numbers
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error   <https://github.com/npm/cli/issues>

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.