-
Notifications
You must be signed in to change notification settings - Fork 799
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
Node.js and NPM network dramatically slow #7254
Comments
I'm having the same issue as of today, really bizarre 🤷 |
If you somehow fix it, please reply in this thread. It really annoying issue.. |
Will do. I'm back on native Ubuntu for now since I can't reliably update my project's dependencies. Would be great if someone on the WSL team could take a look given that whatever set of circumstances causes this to happen effectively blocks node development on WSL, which I assume is one of its most popular applications. |
@ssalbdivad I have just reinstalled windows 10 (didn't go forward to insiders preview Win11). However, if I update to Windows 11 Preview, i might get Kernel version: 5.10.43 version. Could you please check if you have issues in that particalar kernel version? |
@ecalcutin Can confirm I'm on 5.10.43. |
So, looks like this issue happens on 5.10.43. Could you please tell, was you running WSL in windows 11 preview? Otherwise, how did you get such kernel version? |
Yes, I'm on Windows 11. |
And to confirm, have you made kernel update manually? (wsl --update) after upgrading to windows 11 ? |
I believe I tried to manually update wsl when I was setting up wslg. Not sure as to whether that actually resulted in any updates or if I was already on 5.10.43. |
Seems like the wsl --update you and me ran, updated kernel version to broken one. If you are able to downgrade kernel version , and you doing get node issue , probably it's kernel issue. |
Interesting, rollback brought me all the way back to 4.19.104, but I'm still having the same issue 🤨 |
That's strange. But I can confirm that Kernel Version 5.10.16 - IS ok. I am working on it right now. Maybe there exists a command to install a specific version of kernel =\ I am really want to use Windows 11. I'll reinstall and upgrade to 11, and will check if WSL works ok without manually updating the kernel. I'll post my status here |
Confirm, that rolling back to 5.10.16 won't fix the issue once you get it after the update. |
I reinstalled windows 10. Did update to Windows 11 120 build. Considering the consequences, issue is not related to WSL 2 Kernel versions, but related to Win11 in general |
That makes sense, although worth noting I have no problems installing the same dependencies from npm on Windows 11 natively (i.e. without WSL). |
@ssalbdivad Hi,
Then reboot and check if it works for you :) |
Closing, due to solution.
|
I think that's a workaround but not a solution. because out-of-the-box WSL doesn't work as expected and requires manual manipulations. |
I have also run into that issue and I'm still on Win 10 with WSL2 on kernel version 5.10.16. The workaround with resolv.conf brakes all DNS resolving so this is not a solution. |
This issue should be reopened, I'm having the same problem here on a fresh windows 11 pro install with wsl2 ubuntu kernel 5.10.16. |
Reopening this to track this issue. |
Happened to me today on latest kernel. Luckily, the resolve.conf hack helped to resolve this issue. I'm disappointed spending $2k+ on a Windows laptop instead of Mac.
|
I have a similar issue with anything node-related, I tried installing a dist via nvm, on my native Linux it downloads in less than a few seconds, on WSL it takes extremely long and then any npm installs after that takes equally long:
|
I'm having similar problems - I have a node server that acts as reverse proxy for various REST APIs and requests that usually takes ~300ms takes 30+ seconds when the node server is running in WSL :( Using Windows 11 and Kernel version: 5.10.102.1 |
I'm having similar problems too |
Same problems. Win 11 Node is unusable because of this, TBH |
It seem to have been an issue with too low MTU on my end. List your interfaces from Windows:
Find the interface WSL is using, for me this was Set the MTU on the interface to match your main interface, for me it was 1500:
(and maybe do a |
Still facing the same issue, MTU set to 1500 and tried the previous solution to delete the resolv.conf |
Same here. my setup process has been the same for WSL for the last two years, only recently on a new machine did I run into this issue. Simply running On my local PC machine my downloads from anywhere are predictably fine, it seems to be a specific issue with node servers and WSL, which is an interaction that I'm really not really sure I understand. Tried different Ubuntu versions (20 vs. 22) to no success. The current resolutions offered currently don't seem to resolve anything, unless I'm applying them wrong - adjusted the resolv.conf and restarted Ubuntu a few times and my machine to no avail. |
im just trying to run an |
FWIW I've experienced this issue several times and had given up on it. I tried both changing What worked for me was installing node inside WSL using n and adding the following to my export N_PREFIX=$HOME/.n
export PATH=$N_PREFIX/bin:$PATH (note the order of the path where I place I had noticed that What I would add to the conversation here is: What do you get when you run |
Yeah I fixed the problem with wsl/node similarly but forgot to post here, sorry. My node was already under wsl but my projects were on the windows part. That's why I had lags. Moved everything to wsl and lags vanished. Very strange though that this wsl-windows communication is so slow. I guess other lag issues might be due to hidden calls to windows part |
The only thing that fixed this for me was installing one of the preview builds of WSL. I don't remember which one specifically but it was several releases before the most recent. I had Node installed inside WSL using n and that had no impact on its performance or network connectivity for me. Everything was still painfully slow and timed out constantly. None of the other suggestions had worked. I'm now running the most recent stable release and it seems to be fine in that as well. |
which version are you using right now? |
(Edited to include more information.)
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
0.39.1
6.14.17
v14.20.0 |
how did you solve? i'm beggining to think the problem is with my network provider. |
my projects were on windows partition (like in c:\sources\ folder), while my node was installed on wsl part. So when I did Another funny reason why your node may lag, it's when, for some strange reason, it's main source of files is set to some dead mirror. A friend of mine just had this problem. |
i've never had this problems before, all my projects were always installed inside wsl not on a mounted windows. When i use 4G from my phone everything works pretty fine |
Disabling IPv6 in the network adapter fixed instantly |
had to format my desktop and did a clean windows install, everythings going pretty fine till now |
This fixed it for me as well. |
IPv6 was also the root cause for me as well. This answer resolved it for me without having to fully disable IPv6:
These were the last 4 lines in the file. |
None of the above solution fixed my issue. all version, machines all are same for me as well. but solution did not work. |
same problem - npm install is painfully slow and takes hours on my WSLv1 (Ubuntu 22.04)+Win11 (Version 10.0.22621.2715) setup (using NTFS paths). On bare Linux instances, even on GitHub Actions runners, it takes seconds or minutes i'll try disabling IPv6 to check if it helps |
In my case I did these, for an Existing project
The removal of package-lock worked like charm. :) |
Windows Build Number
Windows 11 Pro 21H2 Build: 22000.100
WSL Version
Kernel Version
Kernel version: 5.10.43
Distro Version
Ubuntu 20.04
Other Software
I have Ubuntu, Docker (v20.10.7), WSL 2 installed in my system.
I am using
nvm
with node.js (tried different versions still the same results)Repro Steps
Cloned my fresh repo.
npm install
- might pass and actually install.Whenever I want to install an additional package - it might take forever to install.
Expected Behavior
Should run smoothly, without a long time-consuming.
Actual Behavior
I have dramatically slow network speed while working with Node.js and NPM.
I have to cancel and run
![image](https://user-images.githubusercontent.com/42963334/127747609-94fdb2de-eca1-440d-b72f-229c80529b03.png)
npm install
again, and if I am lucky - all packages will be installed, otherwise, I have to cancel and run again.I am unsure why cache revalidation takes so much time
Diagnostic Logs
I ran
![image](https://user-images.githubusercontent.com/42963334/127747651-461ecebf-500e-438b-8ede-9a799142cc06.png)
npm install --verbose
Here 24 mins duration highlighted, so I just canceled.
The text was updated successfully, but these errors were encountered: