I'm having an issue with registry.npmjs.org -- When I attempt to access it through the command line (e.g. implicitly by using the npm
command, or when doing a ping registry.npmjs.org
), the access fails with a EHOSTUNREACH or "Destination unreachable" error. However, if I attempt to access the site through my web browser (Firefox), there's no issue in connecting.
Some online searches indicated that the issue might be related to IPv6/IPv4. And that indeed looks to be the case. Using the developer console indicates that Firefox is connecting to the site with IPv4, and error messages indicate the command line applications are using IPv6 addresses. nslookup registry.npmjs.org
indicates a number of both types of addresses, and using ping
on the IP addresses directly confirms that pinging the IPv4 addresses works, but the IPv6 addresses are unreachable.
I would like to turn off IPv6 address resolution specifically for registry.npmjs.org (or probably the whole of *.npmjs.org). I don't (to my knowledge) have any issues with IPv6 with any other websites, so I do not want to turn off IPv6 globally.
All the help articles I've seen in my searching have been about either turning off IPv6 entirely, turning it off for a particular interface, or changing all sites to prefer IPv4. I'd prefer to avoid doing that, and have the change in settings apply to the resolution of npmjs.org addresses only. Is there a way that can be done?