EN VI

Node.js - Husky add command is deprecated?

2024-03-17 12:00:06
Node.js - 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?

Solution:

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
Answer

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login