Error:
fatal: cannot run .husky No such file or directory
Best Solution
- copy the content of the file (pre-commit)
- delete the file with error (pre-commit)
- npx husky add ./.husky/pre-commit
- open the file and paste the content
- now will work
Another solutions
1- rm -rf node_modules && rm -rf yarn.lock && yarn install
2- chmod +x ./.husky/*
3- rm -rf .git/hooks/pre-commit
Top comments (3)
The solution might not work, when the Editor is set to use CRLF. Using LF will fix this.
Thanks!!!
Helped me too. Thanks for sharing.