Skip to content

[BUG] npm install gets stuck on 'idealTree:lib: sill idealTree buildDeps' #4309

Closed
@fwsmit

Description

@fwsmit

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

When I run npm install in some repository, like https://github.com/mozilla/pdf.js, it gets stuck at the step: 'idealTree:lib: sill idealTree buildDeps'.

Other things like npm -g install don't work either.

Below is the verbose output and debug log attached.

npm-verbose.txt
2022-01-21T23_07_33_102Z-debug-0.log

Expected Behavior

It should install the neccesary packages

Steps To Reproduce

  1. run npm install -g gulp-cli (or any other package presumably)

Environment

  • npm: 8.3.2
  • Node.js: v17.3.0
  • OS Name: Arch Linux
  • System Model Name: Hp Zbook studio G5
  • npm config:

prefix = "/usr" 

; node bin location = /usr/bin/node
; cwd = /home/friso
; HOME = /home/friso
; Run `npm config ls -l` to show all defaults.

Activity

added
Bugthing that needs fixing
Needs Triageneeds review for next steps
Release 8.xwork is associated with a specific npm 8 release
on Jan 21, 2022
MatiasDuhalde

MatiasDuhalde commented on Feb 14, 2022

@MatiasDuhalde

I have the same issue, when trying to install a package globally or locally. I am also running Arch Linux. The command eventually fails with ETIMEDOUT as follows:

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/npm/-/npm-8.3.1.tgz failed, reason: connect ETIMEDOUT 2606:4700::6810:1923:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tracert6/.npm/_logs/2022-02-14T21_16_53_887Z-debug-0.log

The log suggests a problem trying to access https://registry.npmjs.org/npm/-/npm-8.3.1.tgz, but i have no problems accessing the URL from Firefox, or via curl. Also, I am not connected to a proxy, and I haven't changed npm's proxy-related config from its default value.

EDIT: I started tinkering with nvm and found out the following:

  • I tried with both node v17.0.0 with npm v8.1.0 and node v17.5.0 with npm v8.4.1, and neither worked.
  • I tried with node v16.14.0 (npm v8.3.1), and I had no problems running npm install

So, rolling back to v16 might work as a temporary solution, while the issue remains unresolved with node v17.

Environment

  • npm: 8.5.0
  • Node.js: v17.3.1
  • OS Name: Arch Linux 5.16.8-arch1-1
  • System Model Name: Intel i5-6400 (4) @ 3.300GHz
  • npm config:
; node bin location = /usr/bin/node
; cwd = /home/tracert6
; HOME = /home/tracert6
; Run `npm config ls -l` to show all defaults.
nlf

nlf commented on Mar 8, 2022

@nlf
Contributor

i think we need more information to reproduce this one. first off, can you give things a try with npm 8.5.3 and see if you still have problems?

if you do, can you share the package.json you're using? also, can you attempt to remove the node_modules and package-lock.json manually and try again?

nlf

nlf commented on Mar 8, 2022

@nlf
Contributor

@MatiasDuhalde your issue looks to be a problem with ipv6 as you have a timeout occurring during the socket connection. i've seen this happen myself on occasion and have raised the issue internally for investigation with the registry team. can you try running

curl https://registry.npmjs.org --resolve 'registry.npmjs.org:443:[2606:4700::6810:1923]'

and see if you get a response?

MatiasDuhalde

MatiasDuhalde commented on Mar 8, 2022

@MatiasDuhalde

Hey @nlf ! Thanks for the reply!

Using npm 8.5.3 and node 17.6.0, I generated a new package.json file with npm init -y, and tried installing uuid. I got the same behavior as last time, command failed after some time, with the following error:

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/uuid failed, reason: connect ETIMEDOUT 2606:4700::6810:1023:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tracert6/.npm/_logs/2022-03-08T21_28_27_148Z-debug-0.log

The complete log:

0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'uuid' ]
1 info using npm@8.5.3
2 info using node@v17.6.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/tracert6/Downloads/test/.npmrc Completed in 0ms
10 timing config:load:project Completed in 4ms
11 timing config:load:file:/home/tracert6/.npmrc Completed in 2ms
12 timing config:load:user Completed in 2ms
13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 15ms
19 timing npm:load:configload Completed in 15ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 4ms
23 verbose logfile /home/tracert6/.npm/_logs/2022-03-08T21_28_27_148Z-debug-0.log
24 timing npm:load:logFile Completed in 4ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 24ms
28 timing arborist:ctor Completed in 1ms
29 silly logfile start cleaning logs, removing 3 files
30 timing arborist:ctor Completed in 0ms
31 timing idealTree:init Completed in 12ms
32 timing idealTree:userRequests Completed in 2ms
33 silly idealTree buildDeps
34 silly fetch manifest uuid@*
35 silly placeDep ROOT uuid@ OK for: test@1.0.0 want: *
36 timing idealTree:#root Completed in 459704ms
37 timing idealTree:node_modules/uuid Completed in 0ms
38 timing idealTree:buildDeps Completed in 459706ms
39 timing idealTree:fixDepFlags Completed in 0ms
40 timing idealTree Completed in 459721ms
41 timing command:install Completed in 459733ms
42 verbose type system
43 verbose stack FetchError: request to https://registry.npmjs.org/uuid failed, reason: connect ETIMEDOUT 2606:4700::6810:1023:443
43 verbose stack     at ClientRequest.<anonymous> (/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
43 verbose stack     at ClientRequest.emit (node:events:527:28)
43 verbose stack     at TLSSocket.socketErrorListener (node:_http_client:442:9)
43 verbose stack     at TLSSocket.emit (node:events:539: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/tracert6/Downloads/test
45 verbose Linux 5.16.8-arch1-1
46 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "uuid"
47 verbose node v17.6.0
48 verbose npm  v8.5.3
49 error code ETIMEDOUT
50 error syscall connect
51 error errno ETIMEDOUT
52 error network request to https://registry.npmjs.org/uuid failed, reason: connect ETIMEDOUT 2606:4700::6810:1023:443
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
55 timing npm Completed in 459930ms
56 verbose unfinished npm timer reify 1646774907342
57 verbose unfinished npm timer reify:loadTrees 1646774907350
58 verbose code 1
59 error A complete log of this run can be found in:
59 error     /home/tracert6/.npm/_logs/2022-03-08T21_28_27_148Z-debug-0.log

I ran the command you suggested in Arch Linux, but got no response. I tried same command in Debian in the same network, and got a json result immediately.

nlf

nlf commented on Mar 8, 2022

@nlf
Contributor

this is an underlying problem in your arch linux installation it seems. if the above curl command works, then npm should also work, but right now due to the problems with your ipv6 network you're getting the timeout instead. unfortunately not much we can do to help with that one, it'll be on you to figure out how to get your ipv6 stack working correctly.

fwsmit

fwsmit commented on Mar 12, 2022

@fwsmit
Author

Not sure if relevent, but I gave the curl command some time to complete, but it didn't give any results. I don't have ipv6, though.

The issue I had seems to be resolved, though. npm install works again! I'll close this issue

sanzhardanybayev

sanzhardanybayev commented on Apr 29, 2022

@sanzhardanybayev

In my case the problem was in my server's DNS. Once I changed it to Google's installation went fine.

Arturexe

Arturexe commented on May 15, 2022

@Arturexe

I'm on node 18 with npm 8.6 and this is still happening to me out of nowhere. This morning I've set up a new project and now suddenly I can't use npm anymore.

MatiasDuhalde

MatiasDuhalde commented on May 17, 2022

@MatiasDuhalde

I had this problem some time ago, and just as @nlf suggested here #4309 (comment), it was related to my IPv6 stack configuration, and the problem was not limited to the npm registry, but also extended to the communication with other services that use IPv6, as I could diagnose later. Also, in my personal case, the problem was not exactly my OS, but my local network router. After tinkering some time with the router configuration, I could make it work. Unfortunately I can't give more insight on how, since I can't recall the settings I modified, and I'm not very skilled in networking.

marianoarga

marianoarga commented on Jun 8, 2022

@marianoarga

In my case being behind a VPN was causing this issue, I disconnected and it ran just fine

38 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ljharb@nlf@mixn@claudenobs@marianoarga

        Issue actions

          [BUG] npm install gets stuck on 'idealTree:lib: sill idealTree buildDeps' · Issue #4309 · npm/cli