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] TypeError: Cannot read property 'length' of undefined #2116

Closed
simllll opened this issue Nov 3, 2020 · 4 comments
Closed

[BUG] TypeError: Cannot read property 'length' of undefined #2116

simllll opened this issue Nov 3, 2020 · 4 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@simllll
Copy link

simllll commented Nov 3, 2020

Current Behavior:

If I install my monorepo with lerna bootstrap, it fails with

6917 warn ERESOLVE overriding peer dependency
6918 timing idealTree Completed in 236624ms
6919 timing command:install Completed in 236632ms
6920 verbose stack TypeError: Cannot read property 'length' of undefined
6920 verbose stack     at explainDependents (/usr/local/lib/node_modules/npm/lib/utils/explain-dep.js:68:19)
6920 verbose stack     at explainNode (/usr/local/lib/node_modules/npm/lib/utils/explain-dep.js:13:3)
6920 verbose stack     at explainEresolve (/usr/local/lib/node_modules/npm/lib/utils/explain-eresolve.js:24:24)
6920 verbose stack     at explain (/usr/local/lib/node_modules/npm/lib/utils/explain-eresolve.js:64:38)
6920 verbose stack     at EventEmitter.log.warn (/usr/local/lib/node_modules/npm/lib/utils/setup-log.js:20:23)
6920 verbose stack     at Arborist.[warnPeerConflict] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1039:14)
6920 verbose stack     at Arborist.[placeDep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1105:32)
6920 verbose stack     at Arborist.[placeDep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1216:41)
6920 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:767:46
6920 verbose stack     at Array.map (<anonymous>)
6921 verbose cwd /home/simon/Dev/hokify/hokify-frontend
6922 verbose Linux 5.4.0-52-generic
6923 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
6924 verbose node v14.15.0
6925 verbose npm  v7.0.7
6926 error Cannot read property 'length' of undefined
6927 verbose exit 1

Expected Behavior:

should just install everything

Steps To Reproduce:

Kinda hard to say, it's only happening in my monorepo right now, where I had to add some (non needed) react dependecies to solve some peer dependencies issues with storybook.

Environment:

Os: Ubuntu 20.04
Node: 14.15.0
npm: 7.0.7

@simllll simllll added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Nov 3, 2020
@ljharb
Copy link
Contributor

ljharb commented Nov 4, 2020

Can you try with npm v7.0.8?

@simllll
Copy link
Author

simllll commented Nov 4, 2020

Nice, seems to solve my issue! Thanks

@simllll simllll closed this as completed Nov 4, 2020
@ljharb ljharb removed the Needs Triage needs review for next steps label Nov 4, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 19 milestone Nov 16, 2020
@brent-hoover
Copy link

Still see this error with npm v. 7.0.8 using lerna

@ljharb
Copy link
Contributor

ljharb commented Nov 23, 2020

@zenweasel upgrade to v7.0.13 and try?

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

No branches or pull requests

4 participants