npm/arborist

[BUG] TypeError: Cannot read property 'name' of undefined

Closed this issue · 2 comments

Hello,
when doing "npm link" in this npm package root folder, I get this error:

38 verbose stack TypeError: Cannot read property 'name' of undefined
38 verbose stack     at me/.nvm/versions/node/v16.4.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:257:30
38 verbose stack     at Array.some (<anonymous>)
38 verbose stack     at Arborist.filter (me/.nvm/versions/node/v16.4.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:257:12)
38 verbose stack     at me/.nvm/versions/node/v16.4.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js:346:39
38 verbose stack     at Array.filter (<anonymous>)
38 verbose stack     at me/.nvm/versions/node/v16.4.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js:346:12
38 verbose stack     at async Arborist.[loadActualActually] (me/.nvm/versions/node/v16.4.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js:176:5)
38 verbose stack     at async Arborist.reify (me/.nvm/versions/node/v16.4.2/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:134:5)
38 verbose stack     at async Link.linkPkg (me/.nvm/versions/node/v16.4.2/lib/node_modules/npm/lib/link.js:166:5)
39 verbose cwd me/code/github.com/dotansimha/graphql-eslint
40 verbose Linux 5.11.0-051100-generic
41 verbose argv "me/.nvm/versions/node/v16.4.2/bin/node" "me/.nvm/versions/node/v16.4.2/bin/npm" "link"
42 verbose node v16.4.2
43 verbose npm  v7.18.1
44 error Cannot read property 'name' of undefined
45 verbose exit 1

Any idea why I get this error?

Thanks!

Because that package.json lacks a name field, is my guess.

thanks @ljharb you are totally right. The "real" package was actually under packages/plugin and here, the package.json did contained a name field.

Sorry for the noise! closing the issue as it's clearly not related to arborist