diff --git a/README.md b/README.md index 9f57e0779ae1024e7a480a08a2d99f7d2ad984da..07f1f0d80505b6fbb69cf1ad1a1eccd8fd13d9d6 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ - [Docker For Development Environment](#docker-for-development-environment) - [Problems](#problems) - [macOS Troubleshooting](#macos-troubleshooting) +- [WSL Troubleshooting](#wsl-troubleshooting) - [Maintainers](#maintainers) - [License](#license) - [Copyright notice](#copyright-notice) @@ -980,6 +981,40 @@ Here's what you will need to do: Now you should be able to use node as usual. +## WSL Troubleshooting + +If you've encountered this error on WSL-2: + + ```sh + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0curl: (6) Could not resolve host: raw.githubusercontent.com + ``` + +It may be due to your antivirus, VPN, or other reasons. + +Where you can `ping 8.8.8.8` while you can't `ping google.com` + + +This could simply be solved by running this in your root directory: + + ```sh + 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 + ``` + +This deletes your `resolve.conf` file thats automatically generated when u run WSL, creates a new file and puts `nameserver 8.8.8.8`, then creates a `wsl.conf` file and adds `[network]` and `generateResolveConf = false` to prevent auto generation of that file. + +You can check the contents of the file by running: + + ```sh + cat /etc/resolv.conf + ``` + ## Maintainers Currently, the sole maintainer is [@ljharb](https://github.com/ljharb) - more maintainers are quite welcome, and we hope to add folks to the team over time. [Governance](./GOVERNANCE.md) will be re-evaluated as the project evolves.