npm wsl EAI_AGAIN
Running npm ci
on WSL
(Windows Subsystem for Linux) failed with:
npm ERR! syscall getaddrinfo
npm ERR! errno EAI_AGAIN
npm ERR! request to http://registry.npmjs.org/nodemon failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
WSL
can't reach registry.npmjs.org
Solution
rm /etc/resolv.conf
bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
bash -c 'echo "[network]" > /etc/wsl.conf'
bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
chattr +i /etc/resolv.conf
8.8.8.8
(Google's DNS). Stop recreating resolv.conf
on startup
kudos https://github.com/microsoft/WSL/issues/5420#issuecomment-646479747
note to self
it still doesn't work when I'm on my company's VPN. 8.8.8.8
is unreachable. : (