You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm i and npm ls error with the message Cannot read property '0' of undefined after using npm link to a local package.
`npm i` log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/Cellar/node@12/12.17.0/bin/node',
1 verbose cli '/usr/local/opt/node@12/bin/npm',
1 verbose cli 'i'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v12.17.0
4 verbose npm-session e77d216a1001a8ca
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall genward-web@1.0.0
7 info lifecycle genward-web@1.0.0~preinstall: genward-web@1.0.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 verbose stack TypeError: Cannot read property '0' of undefined
10 verbose stack at npa (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:34:25)
10 verbose stack at doesChildVersionMatch (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:61:22)
10 verbose stack at versionMatch (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:758:12)
10 verbose stack at Array.filter (<anonymous>)
10 verbose stack at exports.findRequirement (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:768:23)
10 verbose stack at findChild (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:122:17)
10 verbose stack at computeMetadata (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:132:9)
10 verbose stack at Installer.normalizeCurrentTree (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install.js:414:3)
10 verbose stack at Array.<anonymous> (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
10 verbose stack at LOOP (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
10 verbose stack at /usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
10 verbose stack at /usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install.js:368:5
10 verbose stack at /usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/iferr/iferr.js:3:64
10 verbose stack at asyncMap (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/slide/lib/async-map.js:27:18)
10 verbose stack at exports.getAllMetadata (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:224:3)
10 verbose stack at Installer.loadArgMetadata (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install.js:366:3)
11 verbose cwd /Users/justinyork/genward/genward-web
12 verbose Darwin 19.5.0
13 verbose argv "/usr/local/Cellar/node@12/12.17.0/bin/node" "/usr/local/opt/node@12/bin/npm" "i"
14 verbose node v12.17.0
15 verbose npm v6.14.4
16 error Cannot read property '0' of undefined
17 verbose exit [ 1, true ]
`npm ls` log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/Cellar/node@12/12.17.0/bin/node',
1 verbose cli '/usr/local/opt/node@12/bin/npm',
1 verbose cli 'ls'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v12.17.0
4 verbose stack TypeError: Cannot read property '0' of undefined
4 verbose stack at npa (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:34:25)
4 verbose stack at doesChildVersionMatch (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:61:22)
4 verbose stack at versionMatch (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:758:12)
4 verbose stack at Array.filter (<anonymous>)
4 verbose stack at exports.findRequirement (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:768:23)
4 verbose stack at findChild (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:122:17)
4 verbose stack at computeMetadata (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/deps.js:132:9)
4 verbose stack at /usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/ls.js:43:23
4 verbose stack at /usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/read-shrinkwrap.js:48:14
4 verbose stack at /usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/iferr/iferr.js:3:64
4 verbose stack at /usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/lib/install/read-shrinkwrap.js:33:16
4 verbose stack at tryCatcher (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
4 verbose stack at Promise._settlePromiseFromHandler (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31)
4 verbose stack at Promise._settlePromise (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)
4 verbose stack at Promise._settlePromise0 (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:619:10)
4 verbose stack at Promise._settlePromises (/usr/local/Cellar/node@12/12.17.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:699:18)
5 verbose cwd /Users/justinyork/genward/genward-web
6 verbose Darwin 19.5.0
7 verbose argv "/usr/local/Cellar/node@12/12.17.0/bin/node" "/usr/local/opt/node@12/bin/npm" "ls"
8 verbose node v12.17.0
9 verbose npm v6.14.4
10 error Cannot read property '0' of undefined
11 verbose exit [ 1, true ]
When
When I run npm i and npm ls after using npm link to a local package. I don't know whether other npm commands work. i and ls work properly when the symlink is deleted.
npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.
If your bug is preproducible on v7, please re-file this issue using our new issue template.
If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo
What / Why
npm i
andnpm ls
error with the messageCannot read property '0' of undefined
after usingnpm link
to a local package.`npm i` log
`npm ls` log
When
When I run
npm i
andnpm ls
after usingnpm link
to a local package. I don't know whether other npm commands work.i
andls
work properly when the symlink is deleted.Where
https://github.com/justincy/npm-link-bug
How
Current Behavior
Error
Steps to Reproduce
npm i
andnpm ls
will errorMinimal reproducible example repo: https://github.com/justincy/npm-link-bug
Expected Behavior
No error.
Who
References
The text was updated successfully, but these errors were encountered: