Skip to content

[BUG] Fix ERESOLVE error output #2896

Description

@btmills

Current Behavior:

When I run npm install in https://github.com/eslint/eslint as of tag v7.22.0, npm throws ERESOLVE with the message "Cannot destructure property 'name' of 'node' as it is null."

Expected Behavior:

Now that #2199 is fixed, I'm hopeful we can successfully npm install in eslint/eslint with npm v7 without --legacy-peer-deps. If we're doing something that's incompatible with the new peerdeps model, a more actionable error message would help.

Steps To Reproduce:

$ node --version
v15.11.0
$ npm --version
7.6.3
$ git clone https://github.com/eslint/eslint.git
$ cd eslint
# Latest version as of writing in case a future commit no longer repros
$ git checkout v7.22.0
$ npm install
npm ERR! code ERESOLVE
npm ERR! Cannot destructure property 'name' of 'node' as it is null.

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2021-03-18T04_10_40_533Z-debug.log

This stack trace matches #2548 (comment).

~/.npm/_logs/2021-03-18T04_10_40_533Z-debug.log
0 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:~/eslint/.npmrc Completed in 2ms
9 timing config:load:project Completed in 3ms
10 timing config:load:file:~/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 1ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 11ms
19 verbose npm-session a35acf988004864f
20 timing npm:load Completed in 24ms
21 http fetch GET 200 https://registry.npmjs.org/npm 26ms (from cache)
22 timing arborist:ctor Completed in 1ms
23 timing arborist:ctor Completed in 0ms
24 timing idealTree:init Completed in 17ms
25 timing idealTree:userRequests Completed in 0ms
26 silly idealTree buildDeps
27 silly fetch manifest @babel/core@^7.4.3
28 http fetch GET 200 https://registry.npmjs.org/@babel%2fcore 225ms
29 silly fetch manifest @babel/preset-env@^7.4.3
30 http fetch GET 200 https://registry.npmjs.org/@babel%2fpreset-env 114ms
31 silly fetch manifest acorn@^7.2.0
32 http fetch GET 200 https://registry.npmjs.org/acorn 53ms
33 silly fetch manifest babel-loader@^8.0.5
34 http fetch GET 200 https://registry.npmjs.org/babel-loader 47ms
35 silly fetch manifest webpack@^5.23.0
36 http fetch GET 200 https://registry.npmjs.org/webpack 238ms
37 silly fetch manifest chai@^4.0.1
38 http fetch GET 200 https://registry.npmjs.org/chai 86ms
39 silly fetch manifest cheerio@^0.22.0
40 http fetch GET 200 https://registry.npmjs.org/cheerio 58ms
41 silly fetch manifest common-tags@^1.8.0
42 http fetch GET 200 https://registry.npmjs.org/common-tags 63ms
43 silly fetch manifest core-js@^3.1.3
44 http fetch GET 200 https://registry.npmjs.org/core-js 61ms
45 silly fetch manifest dateformat@^3.0.3
46 http fetch GET 200 https://registry.npmjs.org/dateformat 60ms
47 silly fetch manifest ejs@^3.0.2
48 http fetch GET 200 https://registry.npmjs.org/ejs 71ms
49 silly fetch manifest escape-string-regexp@^3.0.0
50 http fetch GET 200 https://registry.npmjs.org/escape-string-regexp 68ms
51 silly fetch manifest eslint-plugin-eslint-plugin@^2.2.1
52 http fetch GET 200 https://registry.npmjs.org/eslint-plugin-eslint-plugin 51ms
53 silly fetch manifest eslint-plugin-jsdoc@^22.1.0
54 http fetch GET 200 https://registry.npmjs.org/eslint-plugin-jsdoc 56ms
55 silly fetch manifest eslint@^6.0.0
56 http fetch GET 200 https://registry.npmjs.org/eslint 81ms
57 timing idealTree Completed in 1449ms
58 timing command:install Completed in 1462ms
59 verbose stack Error: unable to resolve dependency tree
59 verbose stack     at Arborist.[failPeerConflict] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1157:25)
59 verbose stack     at Arborist.[loadPeerSet] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1134:34)
59 verbose stack     at async Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:838:11)
59 verbose stack     at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:209:7)
59 verbose stack     at async Promise.all (index 1)
59 verbose stack     at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
59 verbose stack     at async Install.install (/usr/local/lib/node_modules/npm/lib/install.js:120:5)
60 verbose cwd ~/eslint
61 verbose Linux 4.19.121-linuxkit
62 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
63 verbose node v15.11.0
64 verbose npm  v7.6.3
65 error code ERESOLVE
66 verbose stack TypeError: Cannot destructure property 'name' of 'node' as it is null.
66 verbose stack     at printNode (/usr/local/lib/node_modules/npm/lib/utils/explain-dep.js:29:5)
66 verbose stack     at explainNode (/usr/local/lib/node_modules/npm/lib/utils/explain-dep.js:13:3)
66 verbose stack     at explainEresolve (/usr/local/lib/node_modules/npm/lib/utils/explain-eresolve.js:24:24)
66 verbose stack     at report (/usr/local/lib/node_modules/npm/lib/utils/explain-eresolve.js:50:3)
66 verbose stack     at module.exports (/usr/local/lib/node_modules/npm/lib/utils/error-message.js:22:24)
66 verbose stack     at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:175:15)
66 verbose stack     at /usr/local/lib/node_modules/npm/lib/npm.js:114:9
67 verbose cwd ~/eslint
68 verbose Linux 4.19.121-linuxkit
69 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
70 verbose node v15.11.0
71 verbose npm  v7.6.3
72 error Cannot destructure property 'name' of 'node' as it is null.
73 verbose exit 1

Environment:

  • OS: macOS 11.2.3 (Intel) or Docker node:15
  • Node: 15.11.0
  • npm: 7.6.3

Activity

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

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions