-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat(install): Add --update-checksums to cli install #4860
Conversation
Update package checksum when there is a checksum mismatch between the repo and the lockfile
Provide the option to update the package checksum when there is a mismatch between the repo and the local yarn.lock file 4817
This change will increase the build size from 10.24 MB to 10.24 MB, an increase of 4.13 KB (0%)
|
This change will increase the build size from 10.24 MB to 10.24 MB, an increase of 3.85 KB (0%)
|
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.
Thanks for sending it, @imsnif!
Really nice and with tests.
Would you also send a PR to add this CLI command to the docs https://yarnpkg.com/en/docs/cli/install?
Sure thing! |
Travis: |
@imsnif, could you merge master into this PR? |
Merged: helped with Travis, but not so much with circleci or appveyor... networking issues? |
**Summary** Fixes yarnpkg#4817. When the `--update-checksums` flag is set, yarn would know to ignore a checksum mismatch between `yarn.lock` and the repository, and instead update the yarn.lock file with the proper checksum(s). **Test plan** Added new tests. To manually check this: 1. Change one or more of the package checksums in `yarn.lock` 2. Delete node_modules (optionally also run `yarn cache clean`) 3. Run `yarn` => checksum mismatch error will be received. 4. Run `yarn --update-checksums` => will install successfully and fix the damaged checksums in `yarn.lock`
Summary
Fixes #4817.
When the
--update-checksums
flag is set, yarn would know to ignore a checksum mismatch betweenyarn.lock
and the repository, and instead update the yarn.lock file with the proper checksum(s).Test plan
Added new tests.
To manually check this:
yarn.lock
yarn cache clean
)yarn
=> checksum mismatch error will be received.yarn --update-checksums
=> will install successfully and fix the damaged checksums inyarn.lock