sh: husky: command not found
See original GitHub issueContext
I’ve setup a node project with husky but when my collegue tries to run npm install on his Mac he gets the following error :
noa-be@1.0.0 prepare
husky install
sh: husky: command not found
npm ERR! code 127
npm ERR! path /Users/X/Desktop/Workspace/project
npm ERR! command failed
npm ERR! command sh -c husky install
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/X/.npm/_logs/2021-04-12T13_07_25_842Z-debug.log
These are the relevant package.json parts:
{
"scripts": {
"prepare": "husky install"
},
"devDependencies": {
"husky": "^5.2.0",
}
}
I thought this would be enough for husky to be installed when running npm install, but it’s not. What am I missing?
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:13 (2 by maintainers)
Top Results From Across the Web
sh: husky: command not found - node.js - Stack Overflow
Temporarily remove the "prepare": "husky install" script from the package.json file. · Run npm i ( npm install ). Dependencies installed ...
Read more >husky: command not found with npm install --production
Recently, while attempting to build a Docker container, I ran into a bit of a dilemma. Upon running npm install --production I was...
Read more >Husky - Git hooks
Command not found ... If you're running Git from an app and the command can be found in your terminal, this means that...
Read more >husky - npm
Start using husky in your project by running `npm i husky`. There are 2595 other projects in the npm registry using husky.
Read more >Getting Started with Git Hooks and Husky | Tower Blog
.husky/pre-commit: line 4: npx: command not found husky - pre-commit hook exited with code 127 (error) husky - command not found in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ctsstc That didn’t work for me.
The following worked (and is cross platform too):
Everything seems alright on local machine, but when I deploy on Heroku, I get this:
The problem was that
husky, being installed indevDependencies, gets stripped away if you setNPM_CONFIG_PRODUCTION=true.