Skip to content

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

Closed

Description

@simllll

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

Activity

  1. added
    Bug
    Needs Triage
    Release 7.x
    on Nov 3, 2020
  2. ljharb commented on Nov 4, 2020

    @ljharb
    Contributor

    Can you try with npm v7.0.8?

  3. simllll commented on Nov 4, 2020

    @simllll
    Author

    Nice, seems to solve my issue! Thanks

  4. removed
    Needs Triage
    on Nov 4, 2020
  5. added this to the OSS - Sprint 19 milestone on Nov 16, 2020
  6. brent-hoover commented on Nov 23, 2020

    @brent-hoover

    Still see this error with npm v. 7.0.8 using lerna

  7. ljharb commented on Nov 23, 2020

    @ljharb
    Contributor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugRelease 7.x

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions