npm / npm/cli

[BUG] Npm install ETIMEDOUT

Open
#4,085 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

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

I am having problems on any installation with npm. See an example log below :
__
0 verbose cli [
0 verbose cli '/home/pi/.config/nvm/versions/node/v17.1.0/bin/node',
0 verbose cli '/home/pi/.config/nvm/versions/node/v17.1.0/bin/npm',
0 verbose cli 'i',
0 verbose cli 'npm',
0 verbose cli '--verbose'
0 verbose cli ]
1 info using npm@8.1.2
2 info using node@v17.1.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 9ms
5 timing config:load:file:/home/pi/.config/nvm/versions/node/v17.1.0/lib/node_modules/npm/npmrc Completed in 4ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 13ms
8 timing config:load:env Completed in 2ms
9 timing config:load:file:/home/pi/Melting-potes/.npmrc Completed in 1ms
10 timing config:load:project Completed in 8ms
11 timing config:load:file:/home/pi/.npmrc Completed in 7ms
12 timing config:load:user Completed in 8ms
13 timing config:load:file:/home/pi/.config/nvm/versions/node/v17.1.0/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 2ms
15 timing config:load:validate Completed in 7ms
16 timing config:load:credentials Completed in 6ms
17 timing config:load:setEnvs Completed in 6ms
18 timing config:load Completed in 66ms
19 timing npm:load:configload Completed in 66ms
20 timing npm:load:setTitle Completed in 1ms
21 timing npm:load:setupLog Completed in 2ms
22 timing config:load:flatten Completed in 16ms
23 timing npm:load:cleanupLog Completed in 10ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 2ms
26 timing npm:load Completed in 133ms
27 timing arborist:ctor Completed in 4ms
28 timing arborist:ctor Completed in 1ms
29 timing arborist:ctor Completed in 0ms
30 timing arborist:ctor Completed in 1ms
31 timing idealTree:init Completed in 128ms
32 timing idealTree:userRequests Completed in 18ms
33 silly idealTree buildDeps
34 silly fetch manifest npm@*
35 silly placeDep ROOT npm@ OK for: want: *
36 timing idealTree:#root Completed in 464709ms
37 timing idealTree:node_modules/npm Completed in 0ms
38 timing idealTree:buildDeps Completed in 464721ms
39 timing idealTree:fixDepFlags Completed in 3ms
40 timing idealTree Completed in 464884ms
41 timing command:install Completed in 464967ms
42 verbose type system
43 verbose stack FetchError: request to http://registry.npmjs.org/npm failed, reason: connect ETIMEDOUT 2606:4700::6810:1423:80
43 verbose stack at ClientRequest. (/home/pi/.config/nvm/versions/node/v17.1.0/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:110:14)
43 verbose stack at ClientRequest.emit (node:events:390:28)
43 verbose stack at Socket.socketErrorListener (node:_http_client:447:9)
43 verbose stack at Socket.emit (node:events:402:35)
43 verbose stack at emitErrorNT (node:internal/streams/destroy:164:8)
43 verbose stack at emitErrorCloseNT (node:internal/streams/destroy:129:3)
43 verbose stack at processTicksAndRejections (node:internal/process/task_queues:83:21)
44 verbose cwd /home/pi/Melting-potes
45 verbose Linux 5.10.63-v7+
46 verbose argv "/home/pi/.config/nvm/versions/node/v17.1.0/bin/node" "/home/pi/.config/nvm/versions/node/v17.1.0/bin/npm" "i" "npm" "--verbose"
47 verbose node v17.1.0
48 verbose npm v8.1.2
49 error code ETIMEDOUT
50 error syscall connect
51 error errno ETIMEDOUT
52 error network request to http://registry.npmjs.org/npm failed, reason: connect ETIMEDOUT 2606:4700::6810:1423:80
53 error network This is a problem related to network connectivity.
53 error network In most cases you are behind a proxy or have bad network settings.
53 error network
53 error network If you are behind a proxy, please make sure that the
53 error network 'proxy' config is set properly. See: 'npm help config'
54 verbose exit 1
__
no proxy problem (see config below)
__
I tried to set registry in http or https: same result ( respond to ping by the way).
I also tried to reinstall everything, clean the cache several times, delete the package-lock file, deactivate the firewall of my box.

node version v17.1.0
npm version 8.1.2

I have exhausted all the leads I could find online, can you help me with this problem? thanks in advance

Expected Behavior

normal install from npm

Steps To Reproduce

I'm not really sure how, but each time i reinstall node and npm I meet the same outcome

Environment
  • npm: 8.1.2
  • Node: 17.1.0
  • OS :Raspbian 11 bullseye
  • platform: Raspberry Pi 3
  • npm config:
    ; "default" config from default values

_auth = (protected)
access = null
all = false
allow-same-version = false
also = null
audit = true
audit-level = null
auth-type = "legacy"
before = null
bin-links = true
browser = null
ca = null
cache = "/home/pi/.npm"
cache-max = null
cache-min = 0
cafile = null
call = ""
cert = null
ci-name = null
cidr = null
color = true
commit-hooks = true
depth = null
description = true
dev = false
diff = []
diff-dst-prefix = "b/"
diff-ignore-all-space = false
diff-name-only = false
diff-no-prefix = false
diff-src-prefix = "a/"
diff-text = false
diff-unified = 3
dry-run = false
editor = "vi"
engine-strict = false
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
fetch-timeout = 300000
force = false
foreground-scripts = false
format-package-lock = true
fund = true
git = "git"
git-tag-version = true
global = false
global-style = false
globalconfig = "/home/pi/.config/nvm/versions/node/v17.1.0/etc/npmrc"
heading = "npm"
https-proxy = null
if-present = false
ignore-scripts = false
include = []
include-staged = false
include-workspace-root = false
init-author-email = ""
init-author-name = ""
init-author-url = ""
init-license = "ISC"
init-module = "/home/pi/.npm-init.js"
init-version = "1.0.0"
init.author.email = ""
init.author.name = ""
init.author.url = ""
init.license = "ISC"
init.module = "/home/pi/.npm-init.js"
init.version = "1.0.0"
json = false
key = null
legacy-bundling = false
legacy-peer-deps = false
link = false
local-address = null
location = "user"
lockfile-version = null
; loglevel = "notice" ; overridden by cli
logs-max = 10
; long = false ; overridden by cli
maxsockets = 15
message = "%s"
metrics-registry = "http://registry.npmjs.org/"
node-options = null
node-version = "v17.1.0"
noproxy = [""]
npm-version = "8.1.2"
offline = false
omit = []
only = null
optional = null
otp = null
pack-destination = "."
package = []
package-lock = true
package-lock-only = false
parseable = false
prefer-offline = false
prefer-online = false
prefix = "/home/pi/.config/nvm/versions/node/v17.1.0"
preid = ""
production = null
progress = true
proxy = null
read-only = false
rebuild-bundle = true
; registry = "https://registry.npmjs.org/" ; overridden by user
save = true
save-bundle = false
save-dev = false
save-exact = false
save-optional = false
save-peer = false
save-prefix = "^"
save-prod = false
scope = ""
script-shell = null
searchexclude = ""
searchlimit = 20
searchopts = ""
searchstaleness = 900
shell = "/bin/bash"
shrinkwrap = true
sign-git-commit = false
sign-git-tag = false
sso-poll-frequency = 500
sso-type = "oauth"
strict-peer-deps = false
; strict-ssl = true ; overridden by user
tag = "latest"
tag-version-prefix = "v"
timing = false
tmp = "/tmp"
umask = 0
unicode = true
update-notifier = true
usage = false
user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}"
userconfig = "/home/pi/.npmrc"
version = false
versions = false
viewer = "man"
which = null
workspace = []
workspaces = null
yes = null

; "user" config from /home/pi/.npmrc

registry = "http://registry.npmjs.org/"
strict-ssl = true

; "cli" config from command line options

loglevel = "silent"
long = true

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 reproducing npm install npm --verbose with Node 17.1.0 and npm 8.1.2 on Raspberry Pi 3 with Raspbian 11, then compare the shown registry and network configuration. Done means identifying a reproducible npm cause and confirming that a normal install completes, or documenting that the timeout is environmental.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.