Skip to content

Add message for integritySystemParamsDontMatch#5400

Merged
arcanis merged 1 commit intoyarnpkg:masterfrom
wabain:sysparam-error-msg
Feb 28, 2018
Merged

Add message for integritySystemParamsDontMatch#5400
arcanis merged 1 commit intoyarnpkg:masterfrom
wabain:sysparam-error-msg

Conversation

@wabain
Copy link
Copy Markdown
Contributor

@wabain wabain commented Feb 24, 2018

Summary

As of the current stable version, yarn fails with an internal error when yarn check --integrity is run in an environment where the Node version is different from the one listed in the integrity file. This happens because a language key is missing:

$ node --version
v9.2.0

$ yarn check --integrity
yarn check v1.3.2
success Folder in sync.
✨  Done in 0.12s.

$ nvm use stable
Now using node v9.6.1 (npm v5.6.0)

$ yarn check --integrity
yarn check v1.3.2
error An unexpected error occurred: "Unknown language key integrityNodeDoesntMatch".
info If you think this is a bug, please open a bug report with the information provided in "/Users/wabain/code/yarn/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

The integrityNodeDoesntMatch error was just replaced with integritySystemParamsDontMatch in eab88b8, but the error is otherwise the same on master (understandably, since the error only surfaces when running the check command, which is kind of tangential).

This PR adds the missing language key. It also tweaks the error message for when a language key is missing. In this context, "Unknown language key" read like something which could be a problem with some kind of manifest in the user's workspace.

Test plan

Added a test which runs "yarn check --integrity" after changing the systemParams field in the integrity file.

@arcanis
Copy link
Copy Markdown
Member

arcanis commented Feb 28, 2018

Looks good. Thank you!

@arcanis arcanis merged commit 76f9598 into yarnpkg:master Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants