how to setting up?
By using readme.md i install husky npm install husky --save-dev
then i add precommit and prepush hooks to npm.

Now I try to do commits
but hooks not works.
what am I doing wrong?
Hi @jt3k,
Normally running npm install husky --save-dev should automatically trigger installation script for you (node_modules/husky/bin/install.js).
So, just by setting precommit in package.json you should be good.
That said, one reason that could explain why hooks weren't installed is if ignore-scripts is set to true. To verify could you run:
npm config get ignore-scripts # should be false

it seems the problem is installing via add yarn husky --dev
thanx for help!
if you have your own precommit in .git/hooks before npm install husky, than precommit scripts could not be triggered. so just delete your own precommit first.
For some reason the install script didn't trigger for me, so I just ran it manually and it solved the issue:
node node_modules/husky/bin/install.js
The same thing happened to me, I installed husky via Yarn and the install script did not trigger. I spent way too much time narrowing down the problem and finding this topic.
Maybe consider changing the title to a more representative one, and reopening to fix the installation with Yarn? Or is it more on Yarn's side that a fix must be made?
It takes me so much time.This help me . wowowoo
I had this issue because a fork of Husky had been installed from one of my dependencies (Yorkie, from vue-cli), and had written to my .git/hooks directory, so Husky hadn't been able to set itself up.
For people who venture here in the future looking for a quick fix:
yarn add -D husky was the problem for me. Removing node modules and installing everything again fixed it for me.
I have this problem too. husky does not run.
so, i installed it manuly, but still failed. because i had own .git/hooks.
node node_modules/husky/bin/install.js

Still happens in yarn 1.7, need to run the install script manually
@philwolstenholme husky v1.0.0-rc.8 should fix that, it'll overwrite hooks generated by the fork.
You can always run rm -rf .git/hooks && mkdir .git/hooks, if you don't have personal hooks in it.
@divyanshu013 is it with husky v1.0.0-rc.8?
@typicode this is with 0.14.3, didn't realize there was a RC available
You can always run
rm -rf .git/hooks && mkdir .git/hooks, if you don't have personal hooks in it.
This worked for me, thank you so much!
For version 1.3.1 I had to use node node_modules/husky/husky.js install.