-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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] <Freezes during npm install> #7814
Comments
This type of behaviour is not easy to track without reproduction steps or other details. It would be helpful for triaging this issue if you can provide details like package.json, package-lock, npm config, logs and command used. Is it happening for all your project or a specific one ? |
Same issue in my project. With npm 10.8.3 and below everything ok. My dockerfile:
Checked on 5 machines. |
for some reason mine is not showing any delays... ~/workarea/rep $ cat dockerfile
FROM node:18.19-alpine as node
WORKDIR /home/node/frontend
RUN npm install -g [email protected]
RUN npm i -g @angular/[email protected] --verbose
/workarea/rep $ docker build .
[+] Building 27.6s (8/8) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 173B 0.0s
=> [internal] load metadata for docker.io/library/node:18.19-alpine 0.5s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/4] FROM docker.io/library/node:18.19-alpine@sha256:c7620fdecfefb96813da62519897808775230386f4c8482e972e37b8b18cb460 0.0s
=> CACHED [2/4] WORKDIR /home/node/frontend 0.0s
=> [3/4] RUN npm install -g [email protected] 3.2s
=> [4/4] RUN npm i -g @angular/[email protected] --verbose 23.5s
=> exporting to image 0.4s
=> => exporting layers 0.4s
=> => writing image sha256:4b808728df586e52ff67c1be40887acd0af1795376777f9f2123631b7df2f1d8 |
npm registry. 5 machines was in different locations in Poland with different ISP. |
ok then that sounds like it mostly not be registry related. |
It seems problem is related to high dns pool rate. I have pi-hole as dns in my network. In pi-hole log I have information about rate limiting for my IP: "Client 192.168.8.113 has been rate-limited (current config allows up to 1000 queries in 60 seconds)". It happens only in one moment during install - before line logs with [email protected] There is no |
@mi-lchlebowski Do you think this is related to #4028? |
I've seen something like this with npm 10.9.0 when run by docker build. Doesn't occur on the host machine. Doesn't occur with npm 10.8.3. Workaround was to pin npm to 10.8. |
I'm having the same issue with 10.9.0 when building docker images. |
No. Issue is always in same place. @riceyrice @dirkhekhuisascendtek please add -ddd to IMO it may be related to dns queries. On docker there is no dns cache instead host machine. |
We've been experiencing the same issue. NPM installs from a You can see that npm logs Another thing to note is this line, where it seems it took npmjs.org almost 30 minutes to reply to the advisories call.
|
Same here. Only get the problems with our corporate VPN. Moving back to NPM 10.8.0 helps. Goging back to 10.9.0 breaks again. Also 10.9.0 works in our office network (without VPN). |
I had the same issue when I upgraded NPM to v10.9: it freezes (the animations stops) after a while when running commands installing packages. |
Could be - it froze for around 25 minutes, with a
|
Aha, I was writing up network details in case this is some DNS thing: Docker 4.34.2 (167172) on Windows 11 with WSL2 backend, Tailscale VPN (disconnected). Connected the VPN and the delay is 5s instead:
|
Since it's not reproducible/traced even based on logs, Please provide as much information as you can, this would help greatly. just like attached Logs ( Thanks for that ), Operating system information, versions of tech stack used, configs, package file etc. |
I have the same issue and I already explained it in #4028 (comment) Since I can reproduce it 100% of the time after npm 10.4.0, I could help providing a repro because I'm at loss on debugging this further (but because it happens only when there is a lot of dependencies it cannot really be a minimal repro, I can just copy paste my package.json from a project that has it) |
Happened to me in WSL after upgrade to NodeJS 22.10.0, which comes with npm 10.9.0, while nvm installs packages listed in ~/.nvm/default-packages. Downgrade to 10.8.3 helps. |
It's really random. I've just done |
Strangely I had a moment today where it suddenly worked. Then I cleared the cache (
Then it wait's for more than an hour. Now when I press Ctrl-C and try another time it works. Here's how the log continues, with some overlapping lines:
It might be interesting, that in the second part there's a size of yallist, which is undefined in the first part: |
Hey, I have also noticed this bug in one of my solutions, but it seems to struggle only with older packages, as projects with up to date stuff don't seem to be affected. In my windows workstation environment in cmd everything installs and builds fine, but in docker build on the same computer, the older solutions hangs, it takes 45 minutes for npm i step, but it goes thru and doesn't crash, so I assume there is some spaghetti involved. To people struggling with this bug in docker, an easy temporary fix is to change in the dockerfile |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
While running the command npm install with the latest version (V10.9.0), the installation pauses and does not proceed further.
To resolve this, I have attempted the following steps:
But none of these worked.
Expected Behavior
Sould have installed the dependencies and created package-lock.json and node_modules.
Steps To Reproduce
Environment: Using Visual Studio Code with Node.js version 20.13.1.
React and TypeScript: The project uses React version 18.2.0 and TypeScript version 5.3.3.
Command: When I run npm install, the process appears to be loading continuously without any further progress.
Environment
`
The text was updated successfully, but these errors were encountered: