question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not working with husky (cygpath)

See original GitHub issue
husky > 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:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:15

github_iconTop GitHub Comments

11reactions
BoBoooooocommented, Nov 18, 2020

Is theer a fix or workaround for this? I’m still getting a similar error

─ git commit -am "fix"
husky > pre-commit (node v12.18.3)
⚠ Some of your tasks use `git add` command. Please remove it from the config since all modifications made by tasks will be automatically added to the git commit index.

✔ Preparing...
✔ Running tasks...
✔ Applying modifications...
✔ Cleaning up... 
husky > commit-msg (node v12.18.3)
sh: commitlint: command not found <<<<<< broken here
husky > commit-msg hook failed (add --no-verify to bypass)

try: cnpm install @commitlint/config-conventional @commitlint/cli -g

6reactions
aminyacommented, Sep 23, 2020
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found