-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ci): lock file validation #4363
fix(ci): lock file validation #4363
Conversation
5319356
to
7a51d96
Compare
Make sure to validate any lock file (either package-lock.json or npm-shrinkwrap.json) against the current install. This will properly throw an error in case any of the dependencies being installed don't match the dependencies that are currently listed in the lock file. Fixes: npm#2701 Fixes: npm#3947
7a51d96
to
2620447
Compare
throw new Error( | ||
'`npm ci` can only install packages when your package.json and ' + | ||
'package-lock.json or npm-shrinkwrap.json are in sync. Please ' + | ||
'update your lock file with `npm install` ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 having a path to resolution here explicitly laid out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed! to be fair it's not my doing 😁 I'm just reinstating the message from v6:
Invalid typescript version makes `npm ci` fail in the latest npm npm/cli#4363 Merge conflict was introduced in primer#1771
Invalid typescript version makes `npm ci` fail in the latest npm npm/cli#4363 Merge conflict was introduced in #1771
Hi! Are there plans for back-porting this fix to npm@v7? |
Make sure to validate any lock file (either
package-lock.json
ornpm-shrinkwrap.json
) against the current install. This will properlythrow an error in case any of the dependencies being installed don't
match the dependencies that are currently listed in the lock file.
References
Fixes: #2701
Fixes: #3947