Not working with husky (cygpath)
See original GitHub issuehusky > commit-msg (node v13.11.0)
/c/Users/yahyaaba/Documents/GitHub/atom-ide-community/atom-ide-datatip/node_modules/.bin/commitlint: line 5: cygpath: command not found
internal/modules/cjs/loader.js:979
throw err;
^
Error: Cannot find module 'C:\commitlint\cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
at Function.Module._load (internal/modules/cjs/loader.js:859:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
husky > commit-msg hook failed (add --no-verify to bypass)
My deps:
"@commitlint/config-conventional": "^8.3.4",
"commitlint": "^8.3.5",
"husky": "^4.2.5"
using "@commitlint/cli": "^8.3.5",
instead doesn’t help.
husky > commit-msg (node v13.11.0)
sh: commitlint: command not found
husky > commit-msg hook failed (add --no-verify to bypass)
Affected packages
- [ x] cli
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:15
Top Results From Across the Web
Husky 4.x+ not working with Visual Studio Git - Stack Overflow
I found a solution, albeit it not a full explanation. The easy work around is to modify your husky command like so:
Read more >git commit error , something happend with node
[severity:I'm unable to use this version] [regression] [worked-in:16.9.2] /c/Users/ABlue/AppData/Roaming/npm/yarn: line 5: cygpath: command not found ...
Read more >husky - Bountysource
Automatically installing git hooks $ 0. Created 1 year ago in typicode/husky with 3 comments. Troubleshoot Before creating an issue, please check:
Read more >lint-staged - npm
Start using lint-staged in your project by running `npm i lint-staged`. ... Husky is a popular choice for configuring git hooks; Read more ......
Read more >Sublime merge lint-staged cygpath not found
Running windows and powershell for command line, where it works np. husky > pre-commit (node v10.18.0) /c/Source/xxxxxx/node_modules/.bin/lint- ...
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 FreeTop 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
Top GitHub Comments
try: cnpm install @commitlint/config-conventional @commitlint/cli -g
There is a solution in this issue: https://github.com/typicode/husky/issues/673#issuecomment-674292969 or this StackOverflow question: https://stackoverflow.com/questions/61196309/husky-4-x-not-working-with-visual-studio-git
We should use
npx
in the hooks