error: cannot spawn .git/hooks/pre-commit: No such file or directory on Windows
See original GitHub issueHi,
I’m using a windows machine.
When I run standard-version I get:
error: cannot spawn .git/hooks/pre-commit: No such file or directory.
.git/hooks/pre-commit exists and it works if I run the standard-version git commit command manually.
In my project I use Husky which makes my pre-commit hook look like this:
#!/bin/sh
# husky
# v1.0.0-rc.2 win32
export HUSKY_GIT_PARAMS="$*"
node ./node_modules/husky/lib/runner/bin `basename "$0"`
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:6
Top Results From Across the Web
Share - Stack Overflow
I'm using SourceTree and git LFS and had a similar issue: cannot spawn .git/hooks/pre-push . The fix was to delete the pre-push file...
Read more >Error cannot spawn git hooks pre push No error
Go to.git/hooks directory and remove pre-commit file, as its trying to reference to node_modules/pre-commit/hook. It should resolve it.
Read more >Thursday, August 22, 2019 - Tips, Tricks and Tools
Git error: cannot spawn .git/hooks/post-commit: No such file or directory. This error could happen when on the Windows.
Read more >error: cannot spawn git: No such file or directory
> repository it must blow up some internal command line limits on cygwin. Good point, but are you sure you're using Git for...
Read more >Push stopped working / hooks/pre-receive cannot be spawn
Solved it myself: Git installation was broken. Uninstalling and installing git to a different path solved the issue.
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
I got this issue and solved it by putting
#!/bin/sh
as the first line of the pre-commit file. YMMVthe solution is very good