Home > Software engineering >  NPM: request to https://registry.npmjs.org/corepack failed, reason: connect EHOSTUNREACH
NPM: request to https://registry.npmjs.org/corepack failed, reason: connect EHOSTUNREACH

Time:12-27

NPM used to work no problem but now for some reason anything I try to do that involves connecting to the registry times out.

The failure message I get from NPM is request to https://registry.npmjs.org/corepack failed, reason: connect EHOSTUNREACH 2606:4700::6810:1223:443

The command I'm running is npm update -g.

I'm on Arch Linux, and I installed the NPM package from arch. It is version 8.19.2 (the latest on arch).

I tried two DNS, the one I'm using now is Cloudflare (1.1.1.1).

Pinging "registry.npmjs.org" results in From 2600:1700:4630:c000::1 (2600:1700:4630:c000::1) icmp_seq=1 Destination unreachable: Address unreachable

But if I go to registry.npmjs.org in my web browser, I get the expected json result.

Any help is appreciated.

CodePudding user response:

https://askubuntu.com/questions/32298/prefer-a-ipv4-dns-lookups-before-aaaaipv6-lookups/38468#38468

For some reason ipv6 requests are not working on my current network. I "solved" the issue for now by preferring ipv4 using the solution in the link above. Ultimately I'd like to find out why ipv6 is not working on my computer/network but for now this is fine.

  • Related