Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Husky add command is deprecated?

I'm trying to follow this tutorial on how to add a commit msg hook with Husky.

And this is the command given in the tutorial:

npx husky add .husky/commit-msg 'npx commitlint --edit $1'

However when ran it errors with this message:

add command is deprecated

What should we be using instead of add?

like image 919
Ole Avatar asked Apr 22 '26 04:04

Ole


2 Answers

This tutorial has updated instructions.

To install husky just do:

npx husky init

Then install the commit msg file like this:

echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg

Just create a file in .husky/commit-msg, and add this to the file:

npx commitlint --edit $1
like image 28
AJR Avatar answered Apr 24 '26 16:04

AJR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!