Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm install always hangs on first attempt #7891

Closed
2 tasks done
ZachSARAO opened this issue Nov 4, 2024 · 7 comments
Closed
2 tasks done

[BUG] npm install always hangs on first attempt #7891

ZachSARAO opened this issue Nov 4, 2024 · 7 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@ZachSARAO
Copy link

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

Using v10.9.0 that comes with Node v23.1.0, every npm install stop responding. Then I cancel the install, run npm install again and it works. This is on WSL Ubuntu 24 using nvm. Older versions of NPM seem to work fine.

I doubt that I am the only person experiencing this - if so then I can provide more details.

This is the output

(node:3911) ExperimentalWarning: CommonJS module /.../.nvm/versions/node/v23.1.0/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /.../.nvm/versions/node/v23.1.0/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

Expected Behavior

npm install should work.

Steps To Reproduce

Running npm install <package> or just npm install triggers this.

Environment

npm -v # 10.9.0
node -v # v23.1.0
OS: Ubuntu 24
System Model name: Dell XPS 9530

npm config ls gives me:

$ npm config list
; node bin location = /home/me/.nvm/versions/node/v23.1.0/bin/node
; node version = v23.1.0
; npm local prefix = /home/me/path/to/client
; npm version = 10.9.0
; cwd = /home/me/pat/to/client
; HOME = /home/me
@ZachSARAO ZachSARAO added Bug thing that needs fixing Needs Triage needs review for next steps labels Nov 4, 2024
@intersect2-0
Copy link

Experiencing same problem today, sometimes need to cancel and restart multiple times.
No visible errors.
npm install fastify --loglevel verbose
First run npm http fetch GET 200 https://registry.npmjs.org/split2 517ms (cache miss) and hangs.
Second run npm http fetch GET 200 https://registry.npmjs.org/split2 133ms (cache revalidated) and hangs.
Third run successful.

npm verbose os Linux 5.15.153.1-microsoft-standard-WSL2
npm verbose node v22.11.0
npm verbose npm  v10.9.0

@kashif-raza2019
Copy link

I have been experiencing this same issue from quite a while intermittently, thought this might be network related issue but suddenly from past 4 hours now, it is giving me Exit handler error

npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/cli/issues>

npm ERR! A complete log of this run can be found in: C:\Users\KASHIF RAZA\AppData\Local\npm-cache\_logs\2024-11-04T20_56_16_502Z-debug-0.log

Aborting installation.
  npm install has failed.

I have tried downgrading npm version to v9.9.3 but still no resolution.
Node version: v22.5.0

@stefanos82
Copy link

I have the same issue with both v20.18.0 and v22.11.0.

If we add --verbose at the end of npm install, we can clearly see it's an issue with caching revalidation by registry.npmjs.org; it hangs forever, unless you interrupt it and re-execute the command.

@BitPatty
Copy link

BitPatty commented Nov 7, 2024

Same issue with npm 10.9.0 on node 22.11.0.

Workaround

Installing with --force appears to work consistently (further reinforcing the cache suspicion):

npm install --force

@mrdobalina2k
Copy link

mrdobalina2k commented Nov 10, 2024

I had the same issue. Using --force on npm install solved it.

@Tofandel
Copy link

Tofandel commented Nov 11, 2024

This is a duplicate of #4028

npm install --force works because it bypasses checkPlatform checks, it's not a cache issue

You should downgrade to npm 10.3.0

@wraithgar
Copy link
Member

This was fixed in npm 10.9.1 (via npm/npm-install-checks#120)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

8 participants