6

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..

  1. deleting the package.json in my home directory. deleting the
  2. package-lock.json in my home directory. deleting the .npm directory in my home direcory.
  3. clearing the cache with the npm config command
  4. setting https-proxy from the config to null setting proxy from the
  5. config to null setting the registry to https://registry.npmjs.org
  6. setting the registry to htpp://registry.npmjs.org uninstalled npm
  7. and dependencies then reinstalled unintsalled npm and dependencies then installed nvm and reinstalled node through that

npm install --verbose doesnt say any error messages

please somebody help me, i try just about anything shy of reinstalling my os.

greg
  • 103
  • 2
  • 7
  • The output of `tracepath` has nothing to do with whether or not you are using a proxy. A proxy will only be used by specific applications for specific protocols. The use of a proxy could be influence by both environment variables and application-specific configuration files (and they question of "proxy or not" may be entirely irrelevant). – larsks May 05 '22 at 21:18
  • i dont know.. from googling a bunch many of the solutions i found was to configure the correct proxy in npm config. but i dont think i need to be doing that – greg May 05 '22 at 22:17

3 Answers3

23

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"

Igor Zilberman
  • 1,048
  • 1
  • 11
  • 16
0

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
LW001
  • 2,452
  • 6
  • 27
  • 36
Dev Emmy
  • 11
  • 1
-1

go to Control panel > Network & internet > Network & Sharing center > Change Adapter settings > Right click on the network you're using > properties > select internet protocol version4 > click on properties > select obtain automatically for both choices . Enjoy..

This worked for me..