-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Can't find Husky, skipping pre-commit hook #333
Comments
Have you tried to do what error message suggests? |
yes, try many times, including, reinstall the projects, interchange between |
Experiencing the same issue. Reinstalled a hundred times to not avail |
Could you show |
Upgrading to |
|
@alexeyten this is my pre-commit file |
What exact error message do you get? |
I was able to fix this issue with:
|
I got the same error running on windows and it was caused by the fact that the
|
This fixed it for me, thanks @AnimaMundi! |
In addition to @AnimaMundi's suggestion, I had to remove node_modules. rm -rf .git/hooks/
rm -rf node_modules
yarn The corrupted hooks were in my case most likely caused by switching from a branch with [email protected] to a branch with [email protected]. |
I found out that in my case, the problem was that I also had https://www.npmjs.com/package/pre-commit installed, and that overwrote Husky's hooks. I removed this module from |
It recommends to:
However, I needed to force the latest version to fix the issue:
That is of course if you are ok upgrading to the latest version. This error had occurred after I had just updated a bunch of npm packages, so grabbing the latest was ideal. |
@AnimaMundi work for me , thank you! |
Simply uninstalling and reinstalling husky worked for me. My use case is a bit more complex because I'm using a Yarn workspace with husky installed in more than one sub-package, but the uninstall/reinstall cycle in just one of the sub-packages did the trick.
|
Was able to solve it by (manually) deleting the node_modules folder and the package-lock.json, then reinstalling. Working on Linux |
I just deleting the folder .git/hooks/ working on windows |
@ianjamieson |
This worked for me. In package.json "husky": { |
My server was still running which was locking |
look for your if you |
For Yarn: rm -rf .git/hooks
rm -rf node_modules/
brew install git
npm i -D husky
ls .git/hooks
rm -rf node_modules
yarn install |
I believe it is because You must reinstall husky, after PS. If you don't want to delete all the hooks, you can simply PPS. I am back to here after four years (in 2024)! Here is what I needed to do:
|
2021, March. A receipt from 2018 has helped me. |
b/c husky-run is missing and suggested at [1]. [1]: typicode/husky#333 (comment)
work for me~ |
If you are using WSL with windows and not able to solve this issue with any of the above methods, try to commit all your changes with the ubuntu terminal (WSL). |
Shortening the file path in windows saved me. Thanks |
|
yarn in v1.6.0
husky installed information:
config in .huskyrc
I got the below error message:
The text was updated successfully, but these errors were encountered: