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

wsl is freeze on installing packages by npm install #11670

Closed
1 task
haw0k opened this issue Jun 8, 2024 · 10 comments
Closed
1 task

wsl is freeze on installing packages by npm install #11670

haw0k opened this issue Jun 8, 2024 · 10 comments

Comments

@haw0k
Copy link

haw0k commented Jun 8, 2024

Windows Version

Microsoft Windows [Version 10.0.22631.3593]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.146.1-2

Distro Version

Ubuntu 22.04.3 LTS

Other Software

NodeJS v20.14.0

Repro Steps

  1. Open Ubuntu 22.04.3 LTS terminal
  2. cd some_project_with_package.json
  3. npm install

Expected Behavior

The terminal continuously displays the package installation process.

Tasks

Preview Give feedback

Actual Behavior

WSL terminal freezes.
The npm process won't exit by the Ctrl+C command.

$ rm -rf node_modules/
$ npm i
⠏^C^C

The npm process exists.

$ ps axl | grep npm
0  1000     658     375  20   0 3315272 2128964 x64_sy Sl+ pts/0    0:56 npm i

Diagnostic Logs

No response

Tasks

Preview Give feedback
No tasks being tracked yet.
Copy link

github-actions bot commented Jun 8, 2024

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@haw0k
Copy link
Author

haw0k commented Jun 8, 2024

Copy link

github-actions bot commented Jun 8, 2024

Diagnostic information
Detected appx version: 2.1.5.0

@OneBlue
Copy link
Collaborator

OneBlue commented Jun 11, 2024

Thank you @haw0k . Can you share an strace of the process that freezes ? (strace -f )

@KyryloSWAN
Copy link

KyryloSWAN commented Jun 13, 2024

$ npm cache clean --force
$ rm -rf node_modules/ package-lock.json
$ npm i
$ ps ax | grep npm
$ strace -f -p 56172 -o strace.log

Best environment for reproducing: The nextjs empty project created by npx create-next-app@latest
strace.zip

Copy link
Contributor

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

Thank you!

@h3rmanj
Copy link

h3rmanj commented Nov 4, 2024

Did any of you manage to fix this? I'm getting this now, and it only happens if there is no package-lock.json already, so it freezes for all new projects.

@KyryloSWAN
Copy link

Newest versions, same buggy behavior.

> wsl --version
WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4317

@h3rmanj
Copy link

h3rmanj commented Nov 5, 2024

Today it worked again. Updated to latest wsl by manually downloading from releases, and installed node and npm with volta. No idea what fixed it, seems a little random.

> node --version
v22.11.0

> npm --version
10.9.0

> wsl --version
WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4317

@Jikodis
Copy link

Jikodis commented Dec 10, 2024

This is perhaps related to these two issues which seem to be resolved with releases in npm with version 10.9.1.

npm/cli#7868
npm/cli#7814

I was using nvm in WSL to manage my node version. After selecting my node version through nvm I ran npm install -g npm. This allowed my node to use npm v10.9.2. I had no hanging npm installs after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants