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

Bad error message if node_modules doesn't exist #694

Closed
fo-fo opened this issue Mar 23, 2020 · 1 comment · Fixed by #709
Closed

Bad error message if node_modules doesn't exist #694

fo-fo opened this issue Mar 23, 2020 · 1 comment · Fixed by #709

Comments

@fo-fo
Copy link

fo-fo commented Mar 23, 2020

OS: macOS 10.15.3 (also happens on Linux)
Git: 2.26.0
Husky: 4.2.3
Yarn: 1.22.1

Husky hooks don't provide a good error message if node_modules doesn't exist. When the hook is executed, yarn run by husky.sh in .git/hooks prints error Command "husky-run" not found.

What should happen:
It should print the Can't find Husky, skipping $hookName hook message and skip the hook, without failing. Probably the reason for this issue is that yarn's run command returns 1 as its exit code in this situation, and not 127 that husky.sh checks against.

@typicode
Copy link
Owner

typicode commented Apr 9, 2020

Thanks for the heads up, should be good in next patch 👍

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 a pull request may close this issue.

2 participants