New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't add a hook #1043
Comments
Got the same issue, emm.
and then change "npm-run-prepush" to "npm run prepush". |
If you're on Windows, it's an issue with npx. |
Pretty sure. As a quick test, you can add If I remember correctly, you can then run the same command with No workaround possible at husky level. There's probably a tricky parsing issue related to Windows and rn I don't have the time to create a proper issue on npm repo. Duplicate #1010 I've updated docs BTW. |
This solution works in WSL too, thanks. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beep boop, bad bot! We only got a workaround. I haven't seen a solution yet. /edit Thanks, good bot 😊 |
It's definitely a windows npx issue. Use yarn as a workaround |
I'm not going to install yarn for this. First off, our project doesn't use yarn. Secondly, Husky should just work with whatever NPM versions come with the Node.js versions that are officially supported. The real fix is in Husky to properly find its directories, or fix whatever else is going wrong. Not being able to "see" the Or fix it by requiring a very specific NPM version (not recommended as one is not always in control of this, for example when using NVM). |
Seems to be fixed in npm 8.1.1 |
Troubleshoot
https://typicode.github.io/husky/#/?id=troubleshoot
If you're migrating from husky 4, see:
https://typicode.github.io/husky/#/?id=migrate-from-v4-to-v7
Context
I'm using Husky in the command prompt.
Here's what I do:
Also tried with single-quotes, as per the documentation. Both don't work.
Output:
Errrr, that's what I'm doing, aren't I? 🤨
What does it want me to do instead?! No, I'm calling this a bug. I'm doing exactly as the usage instructs me to do, and I can literally copypaste from the documentation and it still won't work:
Sorry mates, but this is not okay. How did this get past testing?
It used to be so simple in Husky v4... Just add a thing in the package.json, and done. Worked everytime, everywhere. I wonder why you had to make everything difficult and unreliable... This is not the first problem I've run into that's new in v7 😑
Please give your huskies, and Husky, some more love 😘
The text was updated successfully, but these errors were encountered: