-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 10.9.0 stuck in wsl with ubuntu environment #7868
Comments
Could reproduce locally (wsl debian and his repo, that I simplified here) and had the same error here:
The issue doesn't seem to happen when docker is running in a VM (ubuntu) instead of WSL... EDIT: passing |
Exact same issue here on Ubuntu 24.04 WSL2 and npm 10.9.0 |
Hi @jonesbusy , do you run npm inside a docker container or directly inside wsl2 ? Because i haven't try in wsl2 directly. |
Directly on WSL. Simple npm i hang. I never faced such issue with Node 18 or 20 on WSL2 I don't see anything particular on logs
Some minutes after
|
EDIT: Well in fact didn't hang. Took 7 minutes
Doing the same on node20 is almost instant |
We have similer issue happening #7814 these might be related. |
Confirming that I am encountering this same hang/freeze and general slowness after updating to npm 10.9.0. Running WSL2 w/ Ubuntu 22.04.3 LTS Fairly small vite project - nothing crazy. Was really slow on things like 'audit' and 'audit fix' . Very slow (10 mins) to complete npm outdated. Gave up after 15 min waiting on npm update. Downgraded to npm @10.8.0 - working good now. |
Same issue here. NPM 10.8.3 it works fine, on 10.9.0 installation freezes for 5-7 minutes. From the logs it looks like the freeze happens just before step "reify moves" (see my output from installing There are also other app-related npm packages installed in this image later on. For some reason, second command with much more packages doesn't trigger this freeze (maybe due to cached content from previous command). Locally on Windows everything works fine regardless of NPM version. |
Has anyone been able to reproduce the exact same issue (npm 10.9 stuck for a few minutes but 10.8 working fine) outside of the context of WSL2 ? Does it happen with any npm package (without vite for example) ? EDIT: Does not get stuck with |
Here is an excerpt of the logs with
There are two places where the process is stuck for a long time. In both places, I see the same call:
cli/workspaces/arborist/lib/arborist/reify.js Line 712 in 977fd57
It's getting late here, but I suspect something wrong going on here, which could explain why this is platform-dependant. |
I am running into a similar issue where npm 10.9.0 just freeze when running eas-cli local build command 10.8.3 worked just fine. |
Similar issue on WSL2 Ubuntu 22.04 and 24.04, NPM 10.9.0 - freeze is particularly prevalent on Freeze is typically 2 hours for projects using an Azure DevOps artifacts registry, and ~50 minutes for projects using NPM registry. Just noticed a possible workaround while trying to test: seems to work without freezing if timing=always is used - i.e. |
I have the issue on a plain Ubuntu 24.04.1, node 22.11.0, npm 10.9.0, clearly reproducible.
works fine with npm 10.8.3
let me know if you want me to test something specific. |
in #7814 someone mentioned |
Yes this is a bit dirty because the report is now generated once at the beginning of a command which could be considered a side effect (but normally treeshaking will only include it only if needed), but the whole process.report is a weirdly built API meant for debugging and not really meant to be used in a normal program But somehow when the call is done in the beginning of the process, this call is very fast, but when it's called after having run a http request (as is currently the case, a single call takes a lot more time to complete, it takes 40s or more on my system when called at the end of npm upgrade) but only a few milliseconds when called at the beginning (this is why it's best to run it outside the function at the beginning of the process as a side effect instead of calling getReport on demand and cache the result) Here is a log of console.time('report') and console.timeEnd('report') before and after the getReport call when run in the end of the upgrade command: ⠼report: 3:10.573 (m:ss.mmm) when run in the beginning of the process at the top level report: 1.943ms This fixes npm hanging npm/cli#4028, npm/cli#7814, npm/cli#7868
This was fixed in npm 10.9.1 (via npm/npm-install-checks#120) |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I wanted to prepare a project with vue3 under docker with the node:22.10-alpine image in my WSL environment, and when I launched the npm installation, npm stuck for 7mn.
I specify the wsl environment, because I have a vagrant environment on the same machine, and I don't have the same problem.
So why am I opening the problem here?
Because if I use version 10.8.0, the installation packages won't be blocked.
I've made a minimal repo for testing here: https://github.com/Vincere1st/minimal-repo-npm-10.9.0-stuck-in-wsl-environnement
If you can't test, i join the results of logs, one with npm 10.8.0 and the other for 10.9.0.
npm-10.8.0-logs.txt
npm-10.9.0-logs.txt
Here the time for the installation of this minimal repo with 10.8.0 version:
And with 10.9.0
Expected Behavior
npm install will not stuck with the latest version in wsl environment.
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: