Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
Referencing the Issue : #4163
#4163
The best way to describe this problem is that for some unknown reason some people cannot make IPV6 connections to registry.npmjs.org - What usually happens then is that the users struggle to find out why npm cannot update and there are no online resources that help with this.
This issue is happening in Node 18+ with the associated npm versions (all versions affected)
Showing the user that they are having a network level problem will avoid a tremendous amount of unnecessary node versioning.
Expected Behavior
Looking at this thread it appears that the issue is widespread enough that the suggestion would be to implement IPv6 and IPv4 connection checks into the "npm ping" and "npm doctor" commands.
If there is a NETWORK TIMEOUT on IPv6 the CLI should attempt an IPV4 connection.
Example of expected behavior
Check Value Recommendation/Notes
npm ping ERR IPv6 Connection timed out
npm ping ok IPv4 Connection 627ms
npm -v ok current: v9.6.5, latest: v9.6.5
node -v ok current: v18.16.0, recommended: v18.16.0
Steps To Reproduce
This is dififcult to reproduce as it affects specific ISP's and users. but In general:
- v18+
- Default configuration
- Any npm command causes this but you can test with "npm ping"
- Error = timed out
Environment
- npm: current: v9.6.5, latest: v9.6.5
- Node.js: current: v18.16.0, recommended: v18.16.0
- OS Name: MacOS / Any OS
- System Model Name:
- npm config:
; node bin location = /Users/xxx/.nvm/versions/node/v18.16.0/bin/node
; node version = v18.16.0
; npm local prefix = /Users/xxx/workspace
; npm version = 9.6.5
; cwd = /Users/xxx/workspace
; HOME = /Users/xxx
; Run `npm config ls -l` to show all defaults.