-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm error EHOSTUNREACH #4237
Comments
This also occurs for other actions connecting to registry.npmjs.org such as It is also happening on Termux (version 0.118.0). Environment
; "user" config from /data/data/com.termux/files/home/.npmrc
foreground-scripts = true
; "cli" config from command line options
global = true
; node bin location = /data/data/com.termux/files/usr/bin/node
; cwd = /data/data/com.termux/files/home
; HOME = /data/data/com.termux/files/home
; Run `npm config ls -l` to show all defaults. |
Going to registry.npmjs.org on the browser works but My home network seems to be blocking it but after using I guess it may have something to do with router IPv6 configuration. |
To me this looks more like a problem with the way nodejs uses |
The issue seems to be broken IPv6. The host has an IPv6 address and thus tries connecting to npm servers via IPv6. This fails. Maybe the router is blocking IPv6 connections. Since NodeJS doesn't have Happy Eyeballs there is no fallback. |
My own network does not have IPv6 (even locally, except for the |
@khorben Really? In that case it's weird that your OS is reporting IPv6 DNS records first if there's no valid route. Which OS are you using? |
NetBSD. As far as I know, IPv6 records are always supposed to be reported before IPv4 records, regardless of the OS. Each and every libc (or resolver library) may implement a different behaviour though. |
And by the way, on that same system, Firefox deals perfectly fine with the same situation and can access |
Sure, it's up to the library. On Windows and most Linuxes at least they reorder the DNS results according to the routing table. |
This seems to be a problem but not anymore on my end. Should I reopen this? |
No. It's not a problem with npm. Neither with NodeJS. |
i am not able to fix it pls help.. |
@dedinsideout Did you upgrade to Node v20? |
I hit this issue when using reference: https://twitter.com/matteocollina/status/1640384245834055680 |
On Jenkins CI host, seems ipV6 is activated but somewhere between the host and the npmjs website ipV6 is not handled. Consequently applying workaround of defaulting to ipv4 in priority npm/cli#4237 (comment) Signed-off-by: Aurélien Pupier <apupier@redhat.com>
On Jenkins CI host, seems ipV6 is activated but somewhere between the host and the npmjs website ipV6 is not handled. Consequently applying workaround of defaulting to ipv4 in priority npm/cli#4237 (comment) Signed-off-by: Aurélien Pupier <apupier@redhat.com>
I have this problem and resolve it. Solution: Disabled IPv6 on the Ubuntu server to resolve the performance and compatibility issues. Edited
Saved the file and applied the changes using the command IPv6 is now permanently disabled on the Ubuntu server, and the network performance has improved. If you encounter similar issues, consider disabling IPv6 following these steps or exploring the alternative methods provided in the article. |
@MohammadGhorayshi No, you are not supposed to disable IPv6! Very bad practice!!! |
@treysis I think someone can't update theire node version, for example use node v14 until, this is not bad practice. thanks man. |
Disabling IPv6 is bad practice and will cause other problems sooner or later. Better just disable IPv6 lookup in NodeJS by using the verbatim option. Don't introduce a system wide change by disabling it for EVERYTHING. |
Is it possible for you to describe this option? |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Expected Behavior
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: