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
# The first time works because node_modules doesn't exist# The generated package-lock.json is correct too
$ npm install
# Remove the package-lock.json to cause the issue
$ rm package-lock.json
# This install succeeds but generates a bad lock file
$ npm install
$ npm install
npm ERR! Cannot read property 'match' of undefined
The lock file contains this JSON object that I think is causing the issue:
"fsevents": {
"dependencies": {
"rc": {}
}
}
Here are the error log, package.json, and both good (first) and bad package-lock.json files:
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 is generating an invalid
package-lock.json
file that causes the following error on subsequent runs ofnpm install
:Expand error
When
The factors that seem to cause the invalid lock file to be generated are:
node_modules
already existspackage-lock.json
does not existHow
Steps to Reproduce
I can reproduce it in a
node:12-alpine
docker container with this minimalizedpackage.json
:and the following commands:
The lock file contains this JSON object that I think is causing the issue:
Here are the error log,
package.json
, and both good (first) and badpackage-lock.json
files:error.log
package.json
good-package-lock.json
bad-package-lock.json
The text was updated successfully, but these errors were encountered: