On Windows 10 npm suddenly can't get internet access in any terminal (Powershell, cmd, wsl, or the terminal in VS Code) when I'm connected to the internet via a mobile phone's hotspot. This was working for years and I don't see what the catalyst was to break it (I hadn't installed anything new or changed any internet settings). If I go to any browser, the internet works fine, it's just from the terminal that it doesn't work. I've tried totally deactivating the firewall and that doesn't fix it. I did run a wsl --shutdown
command a few days before noticing this, but I don't see how that would have such a sweeping impact even outside of wsl. All terminals also connect to the internet normally when over wifi that isn't from a cellphone hotspot. After the problem started, I updated Windows to the latest version of Windows 10 but that didn't do anything. The cellphone I'm using is a Pixel4A.
Update: I can still pip install packages but I can't use npm for anything that requires the internet. For example, running npm outdated
returned this:
...
22 verbose Windows_NT 10.0.19042
23 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "outdated"
24 verbose node v12.18.4
25 verbose npm v6.14.6
26 error code ECONNRESET
27 error errno ECONNRESET
28 error network request to http://registry.npmjs.org/express failed, reason: read ECONNRESET
29 error network This is a problem related to network connectivity.
29 error network In most cases you are behind a proxy or have bad network settings.
29 error network
29 error network If you are behind a proxy, please make sure that the
29 error network 'proxy' config is set properly. See: 'npm help config'
I don't think I'm behind a proxy but I do get this error when I run an app I'm building locally in the browser (the app still builds):
Proxy error: Could not proxy request /favicon.ico from localhost:3000 to http://localhost/.
This is what nslookup returns in cmd and powershell:
PS C:\> nslookup google.com
Server: UnKnown
Address: 192.168.13.64
Non-authoritative answer:
Name: google.com
Addresses: 2607:f8b0:4006:80a::200e
142.250.80.14