Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm freezes during update #6843

Closed
1 of 2 tasks
mdg583 opened this issue Sep 28, 2023 · 4 comments
Closed
1 of 2 tasks

[BUG] npm freezes during update #6843

mdg583 opened this issue Sep 28, 2023 · 4 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release

Comments

@mdg583
Copy link

mdg583 commented Sep 28, 2023

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

(Note that I don't have the latest version of npm installed, because the update command is freezing)

When trying to update npm, the command freezes. The console just seems to sit at this stage indefinitely after idealTree: timing idealTree Completed in 42ms.

[matt@matt-server ~]$ npm install -g npm@latest --verbose
npm verb cli /home/matt/.nvm/versions/node/v18.18.0/bin/node /home/matt/.nvm/versions/node/v18.18.0/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verb title npm install npm@latest
npm verb argv "install" "--global" "npm@latest" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/home/matt/.npm/_logs/2023-09-28T07_36_54_843Z-
npm verb logfile /home/matt/.npm/_logs/2023-09-28T07_36_54_843Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/npm 1387ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/npm 10ms (cache hit)
(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ idealTree: timing idealTree Completed in 42ms

Here is the logfile:

0 verbose cli /home/matt/.nvm/versions/node/v18.18.0/bin/node /home/matt/.nvm/versions/node/v18.18.0/bin/npm
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/home/matt/.nvm/versions/node/v18.18.0/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 3ms
10 timing config:load:file:/home/matt/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/home/matt/.nvm/versions/node/v18.18.0/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:setEnvs Completed in 1ms
15 timing config:load Completed in 10ms
16 timing npm:load:configload Completed in 10ms
17 timing config:load:flatten Completed in 2ms
18 timing npm:load:mkdirpcache Completed in 0ms
19 timing npm:load:mkdirplogs Completed in 1ms
20 verbose title npm install npm@latest
21 verbose argv "install" "--global" "npm@latest" "--loglevel" "verbose"
22 timing npm:load:setTitle Completed in 0ms
23 timing npm:load:display Completed in 2ms
24 verbose logfile logs-max:10 dir:/home/matt/.npm/_logs/2023-09-28T07_49_13_566Z-
25 verbose logfile /home/matt/.npm/_logs/2023-09-28T07_49_13_566Z-debug-0.log
26 timing npm:load:logFile Completed in 7ms
27 timing npm:load:timers Completed in 0ms
28 timing npm:load:configScope Completed in 0ms
29 timing npm:load Completed in 36ms
30 timing config:load:flatten Completed in 0ms
31 silly logfile done cleaning log files
32 http fetch GET 200 https://registry.npmjs.org/npm 578ms (cache revalidated)
33 timing arborist:ctor Completed in 1ms
34 timing idealTree:init Completed in 5ms
35 http fetch GET 200 https://registry.npmjs.org/npm 9ms (cache hit)
36 timing idealTree:userRequests Completed in 31ms
37 silly idealTree buildDeps
38 silly fetch manifest [email protected]
39 silly placeDep ROOT [email protected] OK for:  want: 10.1.0
40 timing idealTree:#root Completed in 8ms
41 timing idealTree:node_modules/npm Completed in 1ms
42 timing idealTree:buildDeps Completed in 10ms
43 timing idealTree:fixDepFlags Completed in 1ms
44 timing idealTree Completed in 48ms

I also tried uninstalling npm, which also freezes.

I tried using npm to install rollup:

[matt@matt-server ~]$ npm install --global rollup --verbose
npm verb cli /home/matt/.nvm/versions/node/v18.18.0/bin/node /home/matt/.nvm/versions/node/v18.18.0/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verb title npm install rollup
npm verb argv "install" "--global" "rollup" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/home/matt/.npm/_logs/2023-09-28T07_58_34_937Z-
npm verb logfile /home/matt/.npm/_logs/2023-09-28T07_58_34_937Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/rollup 20ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/fsevents 6ms (cache hit)
npm verb reify failed optional dependency /home/matt/.nvm/versions/node/v18.18.0/lib/node_modules/rollup/node_modules/fsevents
(##################) ⠦ reify:rollup: timing reifyNode:node_modules/rollup/node_modules/fsevents Completed in 1ms

It seems to freeze here. Corresponding log file:

0 verbose cli /home/matt/.nvm/versions/node/v18.18.0/bin/node /home/matt/.nvm/versions/node/v18.18.0/bin/npm
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/home/matt/.nvm/versions/node/v18.18.0/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 0ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 3ms
10 timing config:load:file:/home/matt/.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:/home/matt/.nvm/versions/node/v18.18.0/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:setEnvs Completed in 1ms
15 timing config:load Completed in 10ms
16 timing npm:load:configload Completed in 10ms
17 timing config:load:flatten Completed in 2ms
18 timing npm:load:mkdirpcache Completed in 0ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm install rollup
21 verbose argv "install" "--global" "rollup" "--loglevel" "verbose"
22 timing npm:load:setTitle Completed in 1ms
23 timing npm:load:display Completed in 2ms
24 verbose logfile logs-max:10 dir:/home/matt/.npm/_logs/2023-09-28T07_58_34_937Z-
25 verbose logfile /home/matt/.npm/_logs/2023-09-28T07_58_34_937Z-debug-0.log
26 timing npm:load:logFile Completed in 7ms
27 timing npm:load:timers Completed in 0ms
28 timing npm:load:configScope Completed in 0ms
29 timing npm:load Completed in 36ms
30 timing config:load:flatten Completed in 0ms
31 timing arborist:ctor Completed in 1ms
32 silly logfile start cleaning logs, removing 1 files
33 timing idealTree:init Completed in 7ms
34 timing idealTree:userRequests Completed in 3ms
35 silly idealTree buildDeps
36 silly fetch manifest rollup@*
37 silly logfile done cleaning log files
38 http fetch GET 200 https://registry.npmjs.org/rollup 20ms (cache hit)
39 silly placeDep ROOT [email protected] OK for:  want: *
40 silly fetch manifest fsevents@~2.3.2
41 http fetch GET 200 https://registry.npmjs.org/fsevents 6ms (cache hit)
42 timing idealTree:#root Completed in 50ms
43 silly placeDep node_modules/rollup [email protected] OK for: [email protected] want: ~2.3.2
44 timing idealTree:node_modules/rollup Completed in 3ms
45 timing idealTree:node_modules/rollup/node_modules/fsevents Completed in 0ms
46 timing idealTree:buildDeps Completed in 54ms
47 timing idealTree:fixDepFlags Completed in 1ms
48 timing idealTree Completed in 66ms
49 timing reify:loadTrees Completed in 69ms
50 timing reify:diffTrees Completed in 1ms
51 silly reify mark retired [ '/home/matt/.nvm/versions/node/v18.18.0/lib/node_modules/rollup' ]
52 silly reify moves {
52 silly reify   '/home/matt/.nvm/versions/node/v18.18.0/lib/node_modules/rollup': '/home/matt/.nvm/versions/node/v18.18.0/lib/node_modules/.rollup-xWvwDHOg'
52 silly reify }
53 timing reify:retireShallow Completed in 2ms
54 timing reify:createSparse Completed in 0ms
55 timing reify:loadBundles Completed in 0ms
56 verbose reify failed optional dependency /home/matt/.nvm/versions/node/v18.18.0/lib/node_modules/rollup/node_modules/fsevents
57 silly reify mark deleted [
57 silly reify   '/home/matt/.nvm/versions/node/v18.18.0/lib/node_modules/rollup/node_modules/fsevents'
57 silly reify ]
58 timing reifyNode:node_modules/rollup/node_modules/fsevents Completed in 1ms
59 timing reifyNode:node_modules/rollup Completed in 30ms
60 timing reify:unpack Completed in 31ms
61 timing reify:unretire Completed in 0ms
62 timing build:queue Completed in 2ms
63 timing build:link:node_modules/rollup Completed in 1ms
64 timing build:link Completed in 1ms
65 timing build:deps Completed in 3ms
66 timing build Completed in 3ms
67 timing reify:build Completed in 3ms

Running htop, I see that two processes npm install rollup are running, each with 100% cpu.

Expected Behavior

npm updates, or at least generates an error message to tell me why it isn't working.

Steps To Reproduce

  • I have nodejs installed from dnf:
nodejs.x86_64                     1:14.19.0-3.fc34                      @updates
  • installed nvm using the install script https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh
  • install node 18.18.0 using nvm:
[matt@matt-server ~]$ nvm ls
->     v18.18.0
         system
default -> lts/* (-> v18.18.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.18.0) (default)
stable -> 18.18 (-> v18.18.0) (default)
lts/* -> lts/hydrogen (-> v18.18.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.18.0
  • try to update npm: npm install -g npm@latest --verbose

Environment

  • npm -v: npm: 9.8.1
  • node -v: Node.js: v18.18.0
  • OS Name: Fedora 34
  • System Model Name: Desktop PC
  • npm config ls:
[matt@matt-server ~]$ npm config ls
; node bin location = /home/matt/.nvm/versions/node/v18.18.0/bin/node
; node version = v18.18.0
; npm local prefix = /home/matt
; npm version = 9.8.1
; cwd = /home/matt
; HOME = /home/matt
; Run `npm config ls -l` to show all defaults.
@mdg583 mdg583 added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Sep 28, 2023
@jamalondon
Copy link

Hopefully a fix can be found for this. Also experiencing a similar issue with "npm install" where it just freezes at "idealTree Completed in 45ms." I too tried to update with "npm update" with the same result happening. Was only able to update npm by uninstalling/reinstalling NodeJS

Environment:
NPM: 10.1.0
Node version: 20.8.0
OS Name: Sonoma 14.0.0 just updated to this today
System Model Name: M2 Macbook Air

@yunissobr
Copy link

deleting node_modules then npm install fixed the issue for me

@milaninfy
Copy link
Contributor

@mdg583 Try to manually uninstall npm in your environment and install latest npm.

@milaninfy
Copy link
Contributor

Closing due to age. If this is still a problem please feel free to reopen this issue, or create a new issue w/ steps to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

4 participants