npm / npm/cli

[DISCUSSION] Is it possible to add an option for using IPv6 only?

Open
#7,078 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

These days I have encounter a problem which is related to IPv4 & IPv6, here is the problem:

  • Commands like npm publish or npm view will fail with error connection timeout (connecting to IP of IPv4 of registry.npmjs.org) after default timeout (5 mins)
  • DNS resolving works normally, returns IPv4 IPs and IPv6 IPs
  • ping <IPv4 IP> works
  • curl -4 https://registry.npmjs.org always timed out
  • curl -6 https://registry.npmjs.org works

I understand that this is a network issue, not a bug, but I wonder if there is a possibility to add an option like ipv6Only to make npm-registry-fetch and npm only use IPv6 in certain conditions.

If it sounds reasonable, I can make a PR.

Thanks.

Related: [npm-registry-fetch issue](https://github.com/npm/npm-registry-fetch/issues/226)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the related npm-registry-fetch issue 226 and the reported behavior of npm publish and npm view when resolving registry.npmjs.org. The issue would need a settled scope for an IPv6-only option and a clear validation plan before implementation can begin.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.