Reputation: 121
i am not using a proxy im just a noob trying to learn how to develop with create-react-app
locally on my machine(linux)
this is the output of tracepath registry.npmjs.org
1?: [LOCALHOST] 0.020ms pmtu 1500
1: 2001:4451:664:1400:caf6:c8ff:fef2:bdcb 2.906ms !N
1: 2001:4451:664:1400:caf6:c8ff:fef2:bdcb 0.995ms !N
Resume: pmtu 1500
i think this proves im not using a proxy.
but i keep getting this error
npm ERR! code ENETUNREACH
npm ERR! syscall connect
npm ERR! errno ENETUNREACH
for anything npm. i dont know what to do.
i have tried..
npm install --verbose
doesnt say any error messages
please somebody help me, i try just about anything shy of reinstalling my os.
Upvotes: 8
Views: 13494
Reputation: 31
I was having the same problem and the above answers were not solving it. What I did is uninstalled everything and then installed all using NVM, which fixed the issue.
Upvotes: -1
Reputation: 31
I just solved this problem for myself by temporarily disabling IPv6.
On Linux here is the command I used:
sudo sysctl net.ipv6.conf.all.disable_ipv6=1
Upvotes: 2
Reputation: 1208
The issue is that node 18 (not happening on 16) is trying to resolve by ipv6 first.
Can override it by exporting the environment variable:
export NODE_OPTIONS="--dns-result-order=ipv4first"
Upvotes: 38