GeezerVison is showing github.com — npm: last nightly / v8-canary make `npm update` unusable · Issue #19405 · nodejs/node
npm: last nightly / v8-canary make npm update unusable #19405Labels npmIssues and PRs related to the npm client dependency or the npm registry.utilIssues and PRs related to the built-in util module. Description
Please, check if this is reproducible:
-
Install/download last nightly or v8-canary build.
-
Run npm update or npm update -g for a package with many dependencies (see an example in npm: last nightly / v8-canary make npm update unusable #19405 (comment)).
I have 1.5 GB memory consumption, ~100% CPU, and never-ending process without any output messages.
Installing / using Node.js v9.8.0 with the same npm fixes the issue. Activityadded windowsIssues and PRs related to the Windows platform. npmIssues and PRs related to the npm client dependency or the npm registry. on Mar 17, 2018vsemozhetbyt commented on Mar 17, 2018 ContributorAuthor More actions The issue seems to appear if something does need to be updated: after successfully updating (npm update -g) with Node.js v9.8.0, npm update -g returns immediately with Node.js v10.0.0, but npm update with outdated packages hangs. changed the title [-]npm: last nightly / v8-canary make `npm update` unusable[/-] [+]npm: last nightly / v8-canary make `npm update` unusable on Windows[/+] on Mar 17, 2018vsemozhetbyt commented on Mar 17, 2018 ContributorAuthor More actions targos commented on Mar 17, 2018 can you run it in verbose mode so we have a better idea about when it starts hanging? Reacted by Vse Mozhe Buty vsemozhetbyt commented on Mar 17, 2018 ContributorAuthor More actions j:\temp\test-npm>npm update --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'update',
npm verb cli '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 5aebf4c4722b2950
npm verb update computing outdated modules to update
npm verb request uri https://registry.npmjs.org/eslint
npm verb request no auth needed
npm info attempt registry request try #1 at 16:17:48
npm verb request using bearer token for auth
npm verb request id f1120122477c2bf9
npm http request GET https://registry.npmjs.org/eslint
npm http 200 https://registry.npmjs.org/eslint
npm verb headers { 'content-type': 'application/json; charset=UTF-8',
npm verb headers server: 'UploadServer',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers 'last-modified': 'Sat, 17 Mar 2018 14:17:19 GMT',
npm verb headers etag: '"5aad236f-8c747"',
npm verb headers 'x-npm-region': 'EU-East',
npm verb headers 'content-encoding': 'gzip',
npm verb headers 'content-length': '35168',
npm verb headers 'accept-ranges': 'bytes',
npm verb headers date: 'Sat, 17 Mar 2018 14:17:50 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers age: '21',
npm verb headers connection: 'keep-alive',
npm verb headers 'x-served-by': 'cache-hhn1528-HHN',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '1',
npm verb headers 'x-timer': 'S1521296270.344240,VS0,VE1',
npm verb headers vary: 'Accept-Encoding, Accept' }
Hangs here. vsemozhetbyt commented on Mar 18, 2018 ContributorAuthor More actions Some debugging data:
v10.0.0-nightly2018011585739b6c5b is OK
v10.0.0-nightly20180116f75bc2c1a5 hangs
So the cause seems to be here: 85739b6...f75bc2c
These frames are the beginning of the infinite spin:
|
log.info('outdated', 'updating', wanted) |
->
|
return this.log.apply(this, a) |
->
|
message = util.format.apply(util, a) |
From there, the data in recursive chains of util.format()/util.inspect() and their sub-calls begins to differ.
So maybe #17907 is the cause.
We may need to fix this before v10 release.
cc @nodejs/util changed the title [-]npm: last nightly / v8-canary make `npm update` unusable on Windows[/-] [+]npm: last nightly / v8-canary make `npm update` unusable[/+] on Mar 18, 2018added utilIssues and PRs related to the built-in util module. and removed windowsIssues and PRs related to the Windows platform. on Mar 18, 2018BridgeAR commented on Mar 21, 2018 This seems to be a formerly hidden bug in npm and not a bug in Node.js.
I do understand that this is something we have to find a solution for soon though. We might just use a high depth limit to circumvent issue like these but that is more like a hack than anything else and could only be a intermediate step. It will still be a recursive call up to the maximum limit and anyone who changes the default to unlimited is also going to run into this.
We could set the limit to e.g., 1000 for now to circumvent the issue. I am just not a fan of doing so because it will prevent anyone else from realizing that there is an issue with their code if they also have a unlimited recursion.
@vsemozhetbyt are you fine with opening a PR against npm to fix the issue? You already know how this works, so I guess it should be relatively straight forward? vsemozhetbyt commented on Mar 21, 2018 ContributorAuthor More actions @BridgeAR Sorry, I've tried to debug to the end but got more and more confused. I am afraid I do not know enough to propose a fix. I've posted an issue in npm, but it has no traction there yet. vsemozhetbyt commented on Mar 23, 2018 ContributorAuthor More actions @Fishrock123, @MylesBorins, can you suggest somebody from npm team to cc here for looking into this issue? Otherwise, we may release v10 with broken npm. BridgeAR commented on Mar 23, 2018 @nodejs/npm please take a look at this. We have to find a solution for this problem before the next major Node.js release and this is therefore urgent. Reacted by Vse Mozhe Buty jasnell commented on Apr 17, 2018 Landed the revert of the change in v10.x-staging jasnell commented on Apr 19, 2018 Note: the revert landed in 10.x but this is still an open issue in master.
MetadataMetadatanpmIssues and PRs related to the npm client dependency or the npm registry.utilIssues and PRs related to the built-in util module. DevelopmentNo branches or pull requestsIssue actions
|