Skip to content

Instantly share code, notes, and snippets.

@AnimeshRy
Created February 6, 2022 17:17
Show Gist options
  • Save AnimeshRy/54dfc9f0b20c84ea203513097ed81556 to your computer and use it in GitHub Desktop.
Save AnimeshRy/54dfc9f0b20c84ea203513097ed81556 to your computer and use it in GitHub Desktop.
WSL2 Ubuntu NPM Install Slow Fix
I tried every solutions here, but nothing works for me.
But I found solutions.
in wsl, type below.
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
sudo bash -c 'echo "[network]" > /etc/wsl.conf'
sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
sudo chattr +i /etc/resolv.conf
After that, type below in cmd with administrator.
wsl --shutdown
Works like a charm! :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment