Skip to content
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

Cannot commit via VS Code Git UI because "check-integrity" fails #414

Open
forabi opened this issue Apr 16, 2018 · 4 comments
Open

Cannot commit via VS Code Git UI because "check-integrity" fails #414

forabi opened this issue Apr 16, 2018 · 4 comments

Comments

@forabi
Copy link
Contributor

forabi commented Apr 16, 2018

Committing from VS Code UI does not work, while committing from the shell works fine.

Git output in VS Code:

[pre-commit ] [common-check] [check-integrity   ] warning Integrity check: System parameters don't match
[pre-commit ] [common-check] [check-integrity   ] error Integrity check failed
[pre-commit ] [common-check] [check-integrity   ] error Found 1 errors.
[pre-commit ] [common-check] [check-integrity   ] npm ERR! code ELIFECYCLE
[pre-commit ] [common-check] [check-integrity   ] npm ERR! errno 1
[pre-commit ] [common-check] [check-integrity   ] npm ERR! track-performance@1.0.0 check-integrity: `yarn check --integrity`
[pre-commit ] [common-check] [check-integrity   ] npm ERR! Exit status 1
[pre-commit ] [common-check] [check-integrity   ] npm ERR! 
[pre-commit ] [common-check] [check-integrity   ] npm ERR! Failed at the track-performance@1.0.0 check-integrity script.
[pre-commit ] [common-check] [check-integrity   ] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[pre-commit ] [common-check] [check-integrity   ] 
[pre-commit ] [common-check] [check-integrity   ] npm ERR! A complete log of this run can be found in:
@wholesomedev
Copy link
Contributor

I'm not sure what's going on there. I tried to reproduce this but I'm able to commit from VS Code, no problem.

Could it be an issue with your npm's specific version? I'm on 5.6.0

@forabi
Copy link
Contributor Author

forabi commented Apr 17, 2018

Same npm version. I'll look into that.

@forabi
Copy link
Contributor Author

forabi commented May 3, 2018

The cause of this issue is that when committing from the GUI, the node executable will refer to the system-wide installed version of Node.js, instead of the "local" version which is set by nvm. This is clearly indicated in the "Output" tab of VS Code:

husky > pre-commit (node v9.11.1)
warning Integrity check: System parameters don't match
error Integrity check failed
error Found 1 errors.

yarn check --integrity fails with "System parameters don't match" because the dependencies were installed with the local Node.js version (e.g. v8.10.0) but the check is being performed against v9.11.1.

Not sure how to solve this. nvm only sets the version for a single shell instance and VS Code does not know about or use nvm. The only way to fix this is to have nvm set the system-wide node version to always match the local one every time it is triggered from any terminal, but that's just confusing and goes against the point of nvm 🤷‍♂️

@forabi
Copy link
Contributor Author

forabi commented May 3, 2018

The only way to fix this is to have nvm set the system-wide node version to always match the local one every time it is triggered from any terminal, but that's just confusing and goes against the point of nvm man_shrugging

Or maybe we could make husky use nvm before it executes the git hooks. Reading through the issues that seems to be the case already but for some reason it's not working for me. Maybe things have changed in husky v1.0? I've opened an issue there to ask about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants