cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] `npm install` started to hang on "still idealTree buildDeps" for 60 seconds if there are dependencies pointing to specific gitlab repository url (a regression compared to npm v6)

Open klesun opened this issue 4 years ago • 74 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

See https://github.com/npm/cli/issues/1991#issuecomment-853984404

Current Behavior

npm install in a fresh project with an explicit git+ssh dependency on a gitlab repo (minimal example) takes 60+ seconds, seemingly it waits for some random network timeout before proceeding the installation.

Expected Behavior

npm install should take 2-3 seconds to install dependencies of the project in minimal example like it did in npm v6.

Steps To Reproduce

See https://gitlab.com/klesun/npm-seven-issue

I reproduced this hang in Ubuntu 20.04 with npm 7.15.1 as well as MacBook Pro 2019 with npm 7.15.1

git clone https://gitlab.com/klesun/npm-seven-issue.git
cd npm-seven-issue
npm install

package.json

{
  "name": "npm-seven-issue",
  "version": "0.0.1",
  "devDependencies": {
    "npm-seven-issue-dep": "git+ssh://[email protected]/klesun/npm-seven-issue-dep#5f1b313978986974d4364585e6bd3689276f1697"
  }
}

If you are using npm version prior to v7.x, for example v6.14.13, npm install should be done within 2-3 seconds.

If you are using npm version v7.0.0 or later, for example 7.15.1, npm install will hang for 60+ seconds with following text:

[....................] \ idealTree.pql-box: still idealTree buildDeps

Note, you need to remove package-lock.json and node_modules prior to retrying the npm install, otherwise issue won't reproduce.

Environment

  • OS: Ubuntu 20.04
  • Node: v16.2.0
  • npm: 7.15.1

as well as

  • OS: MacBook Pro 2019
  • Node: v15.11.0
  • npm: 7.15.1

klesun avatar Jun 03 '21 16:06 klesun

What happens with npm 7 latest? (v7.6 is pretty old at this point)

ljharb avatar Jun 03 '21 16:06 ljharb

Like with ubuntu, when I update npm on my macbook to @latest (7.15.1) I also get the 60+ seconds hang:

klesun@klesuns-MacBook-Pro npm-seven-issue % /usr/bin/time npm install
added 1 package, and audited 2 packages in 1m
found 0 vulnerabilities
       72.94 real         1.45 user         0.26 sys
klesun@klesuns-MacBook-Pro npm-seven-issue % npm -v
7.15.1

Updated npm version in description

klesun avatar Jun 03 '21 16:06 klesun

btw, latest yarn (1.22.10) has no such issues, only 7th npm has

klesun avatar Jun 04 '21 08:06 klesun

npm 7.15.1 here, it's been a week now that this bug cause troubles. On my end it either hangs on "idealTree" or "reify". It seems to stall forever (or at least 5 min). Sometime retrying multiple times do it, but sometime not. I was suspecting some registry issue/lag at first, but yarn has no issue.

cronvel avatar Jun 05 '21 17:06 cronvel

I think it's related to this: https://github.com/npm/cli/issues/3257

midudev avatar Jun 10 '21 09:06 midudev

You could try to execute this using DEBUG=* npm install so more output could be provided. :)

midudev avatar Jun 10 '21 12:06 midudev

@midudev Here's the output that I have, after that NPM seems to hang forever. The only thing that I did before running the command was adding "playwright": "^1.12" in the dev dependencies of package.json.

I have Node v12.22.1 and NPM 7.14.0

Output

``` $ DEBUG=* npm install agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +1s agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +57ms1.0.0 want: ^1.12 agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +2ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 2) free +114mswant: ^1.12 agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +228mswant: ^1.12 agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +13ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +4ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +3ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +7ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +11ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 2) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +1ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +1ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 2) free +192ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 2) free +11ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 3) free +4ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +9ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 2) free +187ms10.0 agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +9mswant: ~1.1.0 agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 2) free +142ms1.1.0 agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +81ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 2, finished: 2) free +1s agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +6ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 2) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +2ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 2) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +1ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 3) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 3) free +398ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 4) free +30ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 3) free +63ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +6ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 2) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 3) free +230ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +6ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 2) reuse on addRequest, timeout 300001ms +1ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 3) free +320ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +8ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 2) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 3, finished: 3) free +632ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +7ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 3) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 4) free +508ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +9ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 4) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 5) free +80ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +5ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 3) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 4) free +79ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +8ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 3) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 4) free +68ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +7ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 3) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 4) free +111ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +7ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 3) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 4, finished: 4) free +126ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +8ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 4) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 5) free +149ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +27ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 5) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) free +108ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +41ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 4) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +1ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 4) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +1ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 4) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +0ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 4) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +2ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 5) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +1ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 7, finished: 6) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[6#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[7#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +2ms agentkeepalive sock[8#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[9#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[10#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[11#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[12#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[13#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[14#registry.npmjs.org:443::::::::true::::::::::] create, timeout 300001ms +1ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 5) free +177ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 5) will be reuse on agent free event +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 7, finished: 7) free +2ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 8, finished: 7) will be reuse on agent free event +0ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 5) free +13ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 5) will be reuse on agent free event +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) free +1ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 7, finished: 6) will be reuse on agent free event +0ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 5) free +61ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 5) will be reuse on agent free event +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 8, finished: 8) free +68ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 7, finished: 7) free +31ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) free +89ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 5) free +7ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) free +7ms agentkeepalive sock[10#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +49ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) free +2ms agentkeepalive sock[13#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +80ms agentkeepalive sock[11#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +71ms agentkeepalive sock[12#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +17ms agentkeepalive sock[6#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +22ms agentkeepalive sock[9#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +57ms agentkeepalive sock[8#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +50ms agentkeepalive sock[14#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +1ms agentkeepalive sock[7#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) free +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +15ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 9, finished: 8) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::] reset timeout to 300001ms +1ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 8, finished: 7) reuse on addRequest, timeout 300001ms +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 8, finished: 8) free +293ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 9, finished: 9) free +2ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +14s agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[1#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) close, isError: false +1ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 5) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +5ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[5#registry.npmjs.org:443::::::::true::::::::::](requests: 5, finished: 5) close, isError: false +0ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +7ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[3#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) close, isError: false +0ms agentkeepalive sock[10#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +50ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[10#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[10#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +0ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +1ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[2#registry.npmjs.org:443::::::::true::::::::::](requests: 6, finished: 6) close, isError: false +1ms agentkeepalive sock[13#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +79ms agentkeepalive timeout listeners: onTimeout, onTimeout +1ms agentkeepalive sock[13#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[13#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +0ms agentkeepalive sock[11#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +70ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[11#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[11#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +0ms agentkeepalive sock[12#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +17ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[12#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[12#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +0ms agentkeepalive sock[6#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +22ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[6#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[6#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +0ms agentkeepalive sock[9#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +58ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[9#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[9#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +1ms agentkeepalive sock[8#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +49ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[8#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +1ms agentkeepalive sock[8#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +0ms agentkeepalive sock[14#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +0ms agentkeepalive timeout listeners: onTimeout, onTimeout +1ms agentkeepalive sock[14#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[7#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +0ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[7#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +1ms agentkeepalive sock[7#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +0ms agentkeepalive sock[14#registry.npmjs.org:443::::::::true::::::::::](requests: 1, finished: 1) close, isError: false +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 8, finished: 8) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +306ms agentkeepalive timeout listeners: onTimeout, onTimeout +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[4#registry.npmjs.org:443::::::::true::::::::::](requests: 8, finished: 8) close, isError: false +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 9, finished: 9) timeout after 15000ms, listeners 2, defaultTimeoutListenerCount 2, hasHttpRequest false, HttpRequest timeoutListenerCount 0 +1ms agentkeepalive timeout listeners: onTimeout, onTimeout +1ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::] is free, destroy quietly +0ms agentkeepalive sock[0#registry.npmjs.org:443::::::::true::::::::::](requests: 9, finished: 9) close, isError: false +0ms [ ] \ reify:playwright: timing reifyNode:node_modules/pngjs Completed in 82ms

</p>
</details>

bperel avatar Jul 01 '21 18:07 bperel

@bperel can you try it with v7.19.1?

ljharb avatar Jul 01 '21 19:07 ljharb

@bperel can you try it with v7.19.1?

It seems to work with 7.19.1

bperel avatar Jul 02 '21 16:07 bperel

@klesun @cronvel @midudev can you also try with npm v7.19.1?

ljharb avatar Jul 02 '21 17:07 ljharb

@ljharb tried again on same mac with v7.19.1 the minimal repro repo, but still getting the lag, 72.92 seconds:

klesun@artur gits % git clone https://gitlab.com/klesun/npm-seven-issue.git
klesun@artur gits % cd npm-seven-issue
klesun@artur npm-seven-issue % DEBUG=* /usr/bin/time npm install
  agentkeepalive sock[0#gitlab.com:443::::::::true:::::::::::::] create, timeout 300001ms +0ms
  agentkeepalive sock[0#gitlab.com:443::::::::true:::::::::::::](requests: 1, finished: 1) free +404ms
  agentkeepalive sock[0#gitlab.com:443::::::::true:::::::::::::] reset timeout to 300001ms +3ms
  agentkeepalive sock[0#gitlab.com:443::::::::true:::::::::::::](requests: 2, finished: 1) reuse on addRequest, timeout 300001ms +0ms
  agentkeepalive sock[0#gitlab.com:443::::::::true:::::::::::::](requests: 2, finished: 1) close, isError: false +29ms
  agentkeepalive sock[1#gitlab.com:443::::::::true:::::::::::::] create, timeout 300001ms +10s
  agentkeepalive sock[1#gitlab.com:443::::::::true:::::::::::::](requests: 1, finished: 0) close, isError: false +41ms
  agentkeepalive sock[2#gitlab.com:443::::::::true:::::::::::::] create, timeout 300001ms +1m
  agentkeepalive sock[2#gitlab.com:443::::::::true:::::::::::::](requests: 1, finished: 0) close, isError: false +48ms
  agentkeepalive sock[3#registry.npmjs.org:443::::::::true:::::::::::::] create, timeout 300001ms +2s
  agentkeepalive sock[3#registry.npmjs.org:443::::::::true:::::::::::::](requests: 1, finished: 1) free +400ms }

added 1 package, and audited 2 packages in 1m

found 0 vulnerabilities
       72.92 real         1.65 user         0.31 sys
klesun@artur npm-seven-issue % npm --version
7.19.1

klesun avatar Jul 02 '21 20:07 klesun

@ljharb It seems to work now, but the bug was not 100% reproducible on my end.

cronvel avatar Jul 03 '21 07:07 cronvel

I got the same problem, but it still occurs in npm v7.19.1

npm install --verbose log:

npm verb cli [
npm verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Users\\johannes\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   'twitch',
npm verb cli   'twitch-auth',
npm verb cli   '--verbose'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm timing npm:load:whichnode Completed in 1ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:C:\Users\johannes\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 3ms
npm timing config:load:builtin Completed in 4ms
npm timing config:load:cli Completed in 3ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:D:\Projects\PanelWorker\.npmrc Completed in 0ms
npm timing config:load:project Completed in 1ms
npm timing config:load:file:C:\Users\johannes\.npmrc Completed in 1ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:C:\Users\johannes\AppData\Roaming\npm\etc\npmrc Completed in 0ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 15ms
npm timing npm:load:configload Completed in 15ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 2ms
npm timing npm:load:cleanupLog Completed in 3ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 2ms
npm timing npm:load Completed in 51ms
npm timing config:load:flatten Completed in 5ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 88ms
npm timing idealTree:userRequests Completed in 3ms
npm verb shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
npm http fetch GET 200 https://registry.npmjs.org/twitch 136ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/twitch-auth 192ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@d-fischer%2fcache-decorators 46ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tslib 44ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/twitch-api-call 135ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/top-package 145ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/twitch-common 155ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@d-fischer%2fdeprecate 858ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@d-fischer%2flogger 868ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@d-fischer%2frate-limiter 884ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@d-fischer%2fshared-utils 999ms (cache revalidated)
npm timing idealTree:#root Completed in 1347ms
npm http fetch GET 200 https://registry.npmjs.org/detect-node 69ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/node-fetch 75ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@types%2fnode 87ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@types%2fnode-fetch 161ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@d-fischer%2fpromise.allsettled 1531ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@d-fischer%2fqs 1548ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@d-fischer%2fcross-fetch 1756ms (cache revalidated)
npm timing idealTree:node_modules/twitch Completed in 1773ms
npm timing idealTree:node_modules/@d-fischer/cache-decorators Completed in 2ms
npm timing idealTree:node_modules/@d-fischer/deprecate Completed in 0ms
npm timing idealTree:node_modules/@d-fischer/logger Completed in 1ms
npm http fetch GET 200 https://registry.npmjs.org/es-abstract 69ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/array.prototype.map 72ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/define-properties 74ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/iterate-value 77ms (cache revalidated)
npm timing idealTree:node_modules/@d-fischer/rate-limiter Completed in 84ms
npm http fetch GET 200 https://registry.npmjs.org/function-bind 119ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-string 130ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/es-to-primitive 134ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/es-array-method-boxes-properly 140ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/get-intrinsic 136ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/call-bind 144ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/has 138ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/object.assign 152ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/string.prototype.trimend 155ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/iterate-iterator 155ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/es-get-iterator 157ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-regex 186ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/has-symbols 191ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-callable 191ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/object-inspect 199ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-negative-zero 203ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/unbox-primitive 201ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/string.prototype.trimstart 205ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/object-keys 222ms (cache revalidated)
npm timing idealTree:node_modules/@d-fischer/promise.allsettled Completed in 233ms
npm timing idealTree:node_modules/@d-fischer/shared-utils Completed in 0ms
npm timing idealTree:node_modules/@types/node Completed in 0ms
npm timing idealTree:node_modules/array.prototype.map Completed in 3ms
npm timing idealTree:node_modules/call-bind Completed in 2ms
npm timing idealTree:node_modules/define-properties Completed in 1ms
npm timing idealTree:node_modules/detect-node Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/which-boxed-primitive 57ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-date-object 65ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/has-bigints 69ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-symbol 78ms (cache revalidated)
npm timing idealTree:node_modules/es-abstract Completed in 89ms
npm timing idealTree:node_modules/es-array-method-boxes-properly Completed in 0ms
npm timing idealTree:node_modules/es-to-primitive Completed in 2ms
npm timing idealTree:node_modules/function-bind Completed in 0ms
npm timing idealTree:node_modules/get-intrinsic Completed in 0ms
npm timing idealTree:node_modules/has Completed in 0ms
npm timing idealTree:node_modules/has-symbols Completed in 0ms
npm timing idealTree:node_modules/is-callable Completed in 0ms
npm timing idealTree:node_modules/is-date-object Completed in 0ms
npm timing idealTree:node_modules/is-negative-zero Completed in 0ms
npm timing idealTree:node_modules/is-regex Completed in 0ms
npm timing idealTree:node_modules/is-string Completed in 0ms
npm timing idealTree:node_modules/is-symbol Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/is-set 63ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-arguments 76ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/isarray 75ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-map 78ms (cache revalidated)
npm timing idealTree:node_modules/iterate-value Completed in 83ms
npm timing idealTree:node_modules/es-get-iterator Completed in 7ms
npm timing idealTree:node_modules/is-arguments Completed in 0ms
npm timing idealTree:node_modules/is-map Completed in 0ms
npm timing idealTree:node_modules/is-set Completed in 0ms
npm timing idealTree:node_modules/iterate-iterator Completed in 0ms
npm timing idealTree:node_modules/object-inspect Completed in 0ms
npm timing idealTree:node_modules/object-keys Completed in 0ms
npm timing idealTree:node_modules/object.assign Completed in 0ms
npm timing idealTree:node_modules/string.prototype.trimend Completed in 0ms
npm timing idealTree:node_modules/string.prototype.trimstart Completed in 0ms
npm timing idealTree:node_modules/top-package Completed in 0ms
npm timing idealTree:node_modules/tslib Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/form-data 54ms (cache revalidated)
npm timing idealTree:node_modules/twitch-api-call Completed in 62ms
npm timing idealTree:node_modules/@d-fischer/cross-fetch Completed in 0ms
npm timing idealTree:node_modules/@d-fischer/qs Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/asynckit 48ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/combined-stream 64ms (cache revalidated)
npm timing idealTree:node_modules/@types/node-fetch Completed in 67ms
npm http fetch GET 200 https://registry.npmjs.org/delayed-stream 49ms (cache revalidated)
npm timing idealTree:node_modules/form-data Completed in 55ms
npm timing idealTree:node_modules/asynckit Completed in 0ms
npm timing idealTree:node_modules/combined-stream Completed in 2ms
npm timing idealTree:node_modules/delayed-stream Completed in 0ms
npm timing idealTree:node_modules/node-fetch Completed in 0ms
npm timing idealTree:node_modules/twitch-auth Completed in 0ms
npm timing idealTree:node_modules/twitch-common Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/is-number-object 65ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-boolean-object 68ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-bigint 89ms (cache revalidated)
npm timing idealTree:node_modules/unbox-primitive Completed in 93ms
npm timing idealTree:node_modules/has-bigints Completed in 0ms
npm timing idealTree:node_modules/which-boxed-primitive Completed in 2ms
npm timing idealTree:node_modules/is-bigint Completed in 0ms
npm timing idealTree:node_modules/is-boolean-object Completed in 0ms
npm timing idealTree:node_modules/is-number-object Completed in 0ms
npm timing idealTree:node_modules/@d-fischer/rate-limiter/node_modules/@types/node Completed in 0ms
npm timing idealTree:node_modules/es-get-iterator/node_modules/isarray Completed in 0ms
npm timing idealTree:buildDeps Completed in 3992ms
npm timing idealTree:fixDepFlags Completed in 3ms
npm timing idealTree Completed in 4094ms
npm timing reify:loadTrees Completed in 4095ms
npm timing reify:diffTrees Completed in 7ms
[         .........] / idealTree: timing reify:diffTrees Completed in 7ms

It freezes at this point and I am not able to close the cmd.exe window anymore

ProfessorVarox avatar Jul 10 '21 12:07 ProfessorVarox

Is there a workaround for this problem? I'm on npm 7.20.1 an the I try npm i when my package.json includes a gutbucket repo with git+ssh it hangs. this is the trace output in my case:

npm i --verbose        
npm verb cli [
npm verb cli   '/Users/mogarick/n/bin/node',
npm verb cli   '/Users/mogarick/n/bin/npm',
npm verb cli   'i',
npm verb cli   '--verbose'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm timing npm:load:whichnode Completed in 1ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/Users/mogarick/n/lib/node_modules/npm/npmrc Completed in 2ms
npm timing config:load:builtin Completed in 2ms
npm timing config:load:cli Completed in 3ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:/Users/mogarick/code/juicy-rn/.npmrc Completed in 0ms
npm timing config:load:project Completed in 1ms
npm timing config:load:file:/Users/mogarick/.npmrc Completed in 1ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:/Users/mogarick/n/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 10ms
npm timing npm:load:configload Completed in 10ms
npm timing npm:load:setTitle Completed in 18ms
npm timing npm:load:setupLog Completed in 0ms
npm timing config:load:flatten Completed in 2ms
npm timing npm:load:cleanupLog Completed in 2ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 1ms
npm timing npm:load Completed in 38ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 830ms
npm timing idealTree:userRequests Completed in 0ms
npm timing arborist:ctor Completed in 0ms

mogarick avatar Jul 26 '21 20:07 mogarick

Same issue for me on NPM 7.20.5 running on a dated version of NodeJS. Oddly enough, the install succeeds only if I run npm in --verbose mode.

metaturso avatar Aug 10 '21 10:08 metaturso

thanks a lot, this really helped me with the problem i had

RichGod93 avatar Sep 15 '21 11:09 RichGod93

Getting a hang with [email protected] also.

When I run it like npm install --no-progress --verbose --loglevel silly I can see the same log lines repeating over and over. This shows to me there is a loop. Node crashes with a gc error on low-ish memory systems.

Not sure if this is the same issue, but I saw a related issue here: https://github.com/npm/cli/issues/3208

ED: One work around was to use a npmv6 generated package-lock.json file, then the install finished running.

illume avatar Sep 21 '21 06:09 illume

I'm seeing the same on CentOS, npm v7.24.0. Hangs forever on idealTree buildDeps.

sudo npm install --verbose -g pm2
npm verb cli [ '/usr/bin/node', '/bin/npm', 'install', '--verbose', '-g', 'pm2' ]
npm info using [email protected]
npm info using [email protected]
...
npm timing npm:load Completed in 46ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 8ms
npm timing idealTree:userRequests Completed in 3ms
⸨⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠹ idealTree:lib: sill idealTree buildDeps

gh-andre avatar Nov 22 '21 00:11 gh-andre

npm v8.1.3 on Arch Linux also hangs forever on idealTree buildDeps when trying to install typescript.

akyoto avatar Nov 23 '21 07:11 akyoto

I profiled npm while it was sitting on npm install lodash for 2 minutes and all it did was trying to write and update the gauge for about 5-8 seconds at a time. Not a single read. For somebody familiar with the code it should be trivial to identify what's going on - just attach a debugger and there it is.

npm-writing-indefinitely

gh-andre avatar Nov 24 '21 02:11 gh-andre

I figured out why npm is hanging in the case described in my comment above. Maybe this will help others identify similar issues.

Basically, npm hangs silently for about 7 minutes (default configuration) if it cannot connect to registry.npmjs.org. In my case, this will happen for any VM created in AWS, in region us-west-2. Other regions, such as us-west-1 and use-east-1, work fine. You can test if that's what's going on in your environment with curl like this.

curl --connect-timeout 15 https://registry.npmjs.org

In a working environment you will get a JSON response right away and in an environment where it cannot connect to the npm registry, it will hang for 15 seconds and report a connection error.

I admire npm's resiliency in trying to install packages, but I wish it would report retries immediately, instead of waiting until it gives up entirely in 7 minutes, even with verbose output.

gh-andre avatar Nov 28 '21 15:11 gh-andre

Having the same issue on ArchLinux. Here's my output when running npm update -g --verbose

npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'update', '-g', '--verbose' ] npm info using [email protected] npm info using [email protected] npm timing npm:load:whichnode Completed in 0ms npm timing config:load:defaults Completed in 1ms npm timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 0ms npm timing config:load:builtin Completed in 0ms npm timing config:load:cli Completed in 1ms npm timing config:load:env Completed in 1ms npm timing config:load:project Completed in 0ms npm timing config:load:file:/home/lucky/.npmrc Completed in 1ms npm timing config:load:user Completed in 1ms npm timing config:load:file:/usr/etc/npmrc Completed in 1ms npm timing config:load:global Completed in 1ms npm timing config:load:validate Completed in 0ms npm timing config:load:credentials Completed in 0ms npm timing config:load:setEnvs Completed in 1ms npm timing config:load Completed in 7ms npm timing npm:load:configload Completed in 7ms npm timing npm:load:setTitle Completed in 0ms npm timing config:load:flatten Completed in 1ms npm timing npm:load:display Completed in 4ms npm verb logfile /home/lucky/.npm/_logs/2022-01-12T04_05_08_729Z-debug-0.log npm timing npm:load:logFile Completed in 2ms npm timing npm:load:timers Completed in 0ms npm timing npm:load:configScope Completed in 0ms npm timing npm:load Completed in 14ms npm timing arborist:ctor Completed in 1ms npm timing idealTree:init Completed in 2ms npm timing idealTree:userRequests Completed in 0ms (( )) | idealTree:lib: sill idealTree buildDeps

GlitchyMark avatar Jan 12 '22 04:01 GlitchyMark

@MJ9001 Try the curl command above. If it times out, check the network for issues - firewall, network access control lists, etc - anything that can block IP or TCP traffic.

gh-andre avatar Jan 12 '22 05:01 gh-andre

@gh-andre Sorry, I should've mentioned that I did try that command. I get a response in about a second with the JSON data. I didn't have any timeout issues either yesterday when troubleshooting or today when verifying.

GlitchyMark avatar Jan 12 '22 22:01 GlitchyMark

@MJ9001 Seems to be a different issue then. The only thing I can think of if any of the packages come from a different npm registry and that one is inaccessible (e.g. scoped packages). Other than that, no idea. Sorry.

gh-andre avatar Jan 12 '22 23:01 gh-andre

I just had this problem and I found that I needed to figure out a problem with my network connection.

mattalxndr avatar Jan 16 '22 09:01 mattalxndr

I have the same problem, I need a help, it's from 3 days I'm looking for this problem

HamzataBarrie avatar Jan 27 '22 09:01 HamzataBarrie

@HamzataBarrie Assuming you're on ArchLinux you may have had the same issue as me. I was having an issue with the official Arch npm package for some reason. I downloaded the linux distribute from the node website instead and dropped that in. Everything worked correctly after that. I didn't look further to find out why. I purged everything related to node several times prior with no success.

GlitchyMark avatar Jan 27 '22 18:01 GlitchyMark

Im on mac running big sur 11.6 and have this issue too. it will install without using the sudo command but it fails to completely install do to the lack of permissions. when using sudo it hangs

charliegunn avatar Feb 04 '22 02:02 charliegunn

This likely isn't everyone's issue, but I was struggling with any npm install after upgrading to npm 7 or npm 8, and found that my user .npmrc file had ca = "" in it. After removing that my installs sped back up to normal speeds.

tobalsgithub avatar Feb 10 '22 22:02 tobalsgithub