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.

Git throwing out error related to Husky while trying to commit

See original GitHub issue

Device: Windows 10

Problem: When I tried to commit, an error was thrown out cannot spawn .husky/pre-commit: no such file or directory

Possible solution that worked for me: Adding #!/bin/sh to the first line of .husky/pre-commit.

PS: I haven’t tested if this would still work on Linux or not

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dwellecommented, Dec 5, 2021

Btw which OS do you use @dwelle? I was thinking getting this PR checked by someone using Linux and maybe Mac as well before merging.

I can check all of them.

0reactions
jai-dewanicommented, Dec 5, 2021

Yeah, I will go ahead and make a PR for this.
I did some research and found out using sh over bash would be better as sh points to whatever will be the default scripting shell in that system.

Btw which OS do you use @dwelle? I was thinking getting this PR checked by someone using Linux and maybe Mac as well before merging.

Read more comments on GitHub >

github_iconTop Results From Across the Web

husky - Strange error when attempting to commit. [subject-empty]
What it means is that you've added a non-Git program (specifically, something called "husky") and told Git to use Husky to check your...
Read more >
Husky pre-commit fails with code 1 (error) · Issue #1014 - GitHub
I was able to resolve this error by running each precommit command individually. Turns out my test command ( jest ) was causing...
Read more >
Preventing bad git commits with Husky - Compositional IT
We've all been in the situation where we've made a commit into source control, pushed, and then instantly realised that we've broken the...
Read more >
githooks Documentation - Git
This hook is invoked by git-commit[1], and can be bypassed with the --no-verify option. It takes no parameters, and is invoked before obtaining...
Read more >
Solving “Fatal: Not A Git Repository” (Or Any Of The Parent ...
This error means that you have some files that have been edited but not committed, and by checking out another branch, you'll overwrite...
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