Closed Silic0nS0ldier closed 3 years ago
Issue can still be reproduced under latest stable version. npm version: 6.14.8 node version: 14.14.0
9529 info lifecycle @babel/helper-compilation-targets@7.12.1~install: @babel/helper-compilation-targets@7.12.1
9530 info lifecycle @babel/helper-compilation-targets@7.12.1~postinstall: @babel/helper-compilation-targets@7.12.1
9531 info lifecycle @babel/preset-env@7.12.1~install: @babel/preset-env@7.12.1
9532 info lifecycle @babel/preset-env@7.12.1~postinstall: @babel/preset-env@7.12.1
9533 info lifecycle undefined@undefined~install: undefined@undefined
9534 info lifecycle undefined@undefined~postinstall: undefined@undefined
9535 verbose stack TypeError: Cannot read property 'length' of undefined
9535 verbose stack at _incorrectWorkingDirectory (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:114:60)
9535 verbose stack at /usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:86:44
9535 verbose stack at /usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:218:12
9535 verbose stack at callback (/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:295:20)
9535 verbose stack at FSReqCallback.oncomplete (fs.js:184:5)
9536 verbose cwd /home/silicon/source/npm-test
9537 verbose Linux 4.19.84-microsoft-standard
9538 verbose argv "/usr/bin/node" "/usr/bin/npm" "ci"
9539 verbose node v14.14.0
9540 verbose npm v6.14.8
9541 error Cannot read property 'length' of undefined
9542 verbose exit [ 1, true ]
Worth noting that the dependency graph seems to affect this, a small unnamed package with a single dependency is unaffected for example.
This issue is fixed in npm v7, however as it is currently hidden behind the 7
tag I'll leave this open for now.
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
Closing: This is an automated message.
What / Why
App/website projects have no need for a package name, so it is omitted. Recently (perhaps due to an environment change, dependency graph change, or npm update) the
npm ci
command has started crashing when close to completion (just before apostinstall
script is run).When
Whenever
npm ci
is run on an unnamedpackage.json
.Where
How
Current Behavior
npm ci
completes installation of dependencies but crashes beforepostinstall
script can be executed, reporting the following error (extract from the debug file).Steps to Reproduce
npm version: 6.9.0 node version: 10.16.2
npm i ; npm ci
on the followingpackage.json
(onlynpm ci
is affected by this bug)Expected Behavior
Missing optional
package.json
properties don't break installs.Who
References