angulargitpre-commit-hookhuskygit-husky

husky > pre-commit hook failed (add --no-verify to bypass)


Suddenly I am getting the "husky > pre-commit hook failed (add --no-verify to bypass)" error message when I give the git commit.

(C:\Windows\System32\cmd.exe)
> git commit
husky > npm run -s precommit (node v12.18.3)

'pretty-quick' is not recognized as an internal or external command,
operable program or batch file.

husky > pre-commit hook failed (add --no-verify to bypass)

I tried git clean command too. Anyone faced similar issue?


Solution

  • Husky can prevent you from bad git commit, git push, and more. If you are getting this error check your code syntax. In case you are getting this error even if your code is valid, please use the below solution.

    #Solution 1:

    Delete the .git/hooks folder and then do the npm install to reinstall husky. There are chances for conflicts with husky-generated files in the .git/hooks/ files.

    #Solution 2:

    this is a temporary/quick solution.

    git commit -m "message" --no-verify