Comments (9)
Huh, sure enough, ensuring that --progress=true
is used made this work! ...but if I disable progress then, yes, the login fails.
from cli.
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.
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.
@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.
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.
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.
manage to reproduce similer behaviour
- Run
npm login --no-progress
- Hit
Enter
- 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.
@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.
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)
- https://github.com/npm/cli/commit/dbe7d983d184fb00c85f7b34839a123057029c8b HOT 2
- [DOCS] npm doesn't install the latest tagged version if engines are invalid HOT 6
- [BUG] npm dist-tag rm only removes the last recently deleted tag HOT 6
- [BUG] `npm publish --provenance` The default value `public` isn't used HOT 5
- [Enchancement] Check files that import the package before uninstalling HOT 1
- [BUG] npm docs with no pkgname arg returns undefined HOT 2
- [BUG] No README.md on npmjs ? HOT 4
- [BUG] Problem / error links are incorrect when path contains prefix before space HOT 3
- [BUG] npm version -ws never update dependencies in package.json HOT 3
- npm ERR! Exit handler never called! npm ERR! This is an error with npm itself. HOT 1
- Licence missing for npm update
- [BUG] <title> HOT 1
- [BUG] npm install --save three: No matching version found for three@^0.777.1. HOT 2
- (npm error Exit handler never called!:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError HOT 1
- [BUG] Unable to upgrade two packages with a dep and peer dep on the same package that is also bumped HOT 5
- npm i changing package-lock.json HOT 3
- [BUG] Windows npm install --prefix errors and looks for the package.json in the cwd HOT 5
- [BUG] <prepare script called with CMD on windows> HOT 1
- Feature request: Add config option to prevent accidental installation of packages in directories without package.json
- [BUG] npm publish <package-spec> in a workspace is not taking package-spec into account
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.