npm fails to install on IPv6 only networks

[note: the forum does not let me post it correctly, as the post is limited to 5 urls - I have modified the URL output below so that I can post here]

What I Wanted to Do

Install node-red using npm install node-red

What Happened Instead

An “ENETUNREACH” error occured

Reproduction Steps

Important: the IPv6 only host CAN reach URL1 via NAT64 - a connection is possible, if npm was using IPv6.


nodejshost:~$ npm install node-red
npm ERR! request to URL1/node-red failed, reason: connect ENETUNREACH IP1:443 - Local (

npm ERR! A complete log of this run can be found in:
npm ERR! /home/app/.npm/_logs/2019-08-16T08_41_18_332Z-debug.log


0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘install’, ‘node-red’ ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose config Skipping project config: /home/app/.npmrc. (matches userconfig)
5 verbose npm-session 958a6ab568040871
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 silly fetchPackageMetaData error for nodered@latest request to [URL] failed, reason: connect ENE
TUNREACH :443 - Local (
9 timing stage:rollbackFailedOptional Completed in 2ms
10 timing stage:runTopLevelLifecycles Completed in 242ms
11 verbose type system
12 verbose stack FetchError: request to URL1/nodered failed, reason: connect ENETUNREACH IP1:443

  • Local (
    12 verbose stack at ClientRequest.req.on.err (/usr/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
    12 verbose stack at ClientRequest.emit (events.js:198:13)
    12 verbose stack at TLSSocket.socketErrorListener (_http_client.js:392:9)
    12 verbose stack at TLSSocket.emit (events.js:198:13)
    12 verbose stack at emitErrorNT (internal/streams/destroy.js:91:8)
    12 verbose stack at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    12 verbose stack at process._tickCallback (internal/process/next_tick.js:63:19)
    13 verbose cwd /home/app
    14 verbose Linux 4.19.41-0-virt
    15 verbose argv “/usr/bin/node” “/usr/bin/npm” “install” “node-red”
    16 verbose node v10.16.0
    17 verbose npm v6.9.0
    18 error code ENETUNREACH
    19 error errno ENETUNREACH
    20 error request to failed, reason: connect ENETUNREACH IP1:443 - Local (

21 verbose exit [ 1, true ]

registry is actually reachable:

nodejshost:~$ curl -I URL1/node-red
HTTP/2 200 
date: Fri, 16 Aug 2019 14:38:47 GMT
content-type: application/json
content-length: 233097
set-cookie: __cfduid=da55720ceef5a3cb2c12da328d8b8706b1565966327; expires=Sat, 15-Aug-20 14:38:47 GMT; path=/;; HttpOnly
cf-cache-status: HIT
cache-control: max-age=300
cf-ray: 5074276978633eae-ZRH
accept-ranges: bytes
age: 4848
etag: "c4fd5e736f7ec287d9f0a0c5c266dc29"
expect-ct: max-age=604800, report-uri=""
last-modified: Fri, 05 Jul 2019 10:48:30 GMT
vary: accept-encoding, accept
x-amz-meta-rev: 174-d2d2e19e1a41a37db439ea4aae471997
server: cloudflare


Platform Info

$ npm --versions
nodejshost:~$ npm --versions
{ npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.9.2',
  icu: '64.2',
  modules: '64',
  napi: '4',
  nghttp2: '1.34.0',
  node: '10.16.0',
  openssl: '1.1.1c',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.29.1',
  v8: '',
  zlib: '1.2.11' }

$ node -p process.platform