Open lydemann opened 6 years ago
I have the same issue:
My package.config
{
"name": "a-project",
"version": "1.0.0",
"husky": {
"hooks": {
"pre-commit": "npm run validate",
"commit-msg": "commitlint -e %HUSKY_GIT_PARAMS%"
}
},
"scripts": {
"validate": "npm run lint",
"release": "standard-version"
},
"devDependencies": {
"@commitlint/cli": "^7.0.0",
"@commitlint/config-conventional": "^7.0.1",
"husky": "^1.0.0-rc.13",
"standard-version": "^4.4.0"
}
}
Error
warning: LF will be replaced by CRLF in CHANGELOG.md.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in CHANGELOG.md.
The file will have its original line endings in your working directory.
error: cannot spawn .git/hooks/pre-commit: No such file or directory
Command failed: git commit CHANGELOG.md -m "chore(release): 1.0.1"
warning: LF will be replaced by CRLF in CHANGELOG.md.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in CHANGELOG.md.
The file will have its original line endings in your working directory.
error: cannot spawn .git/hooks/pre-commit: No such file or directory
Any idea about that? Would be great!
Thank you guys in advance!
Same issue here. I think it is related to Husky and not standard-version. There is an open pull request which might solve the issue: https://github.com/typicode/husky/pull/292
I got this issue and solved it by putting #!/bin/sh
as the first line of the pre-commit file. YMMV
I had similar issue after installing husky and I have noticed that my pre-commit file had a space between #
and !/bin/sh
Finally after removing the white space and setting the firest line to #!/bin/sh
it worked
In my case, I changed #!/bin/bash
to #!/bin/sh
and the error went away.
🤦♂️
I got this issue and solved it by putting
#!/bin/sh
as the first line of the pre-commit file. YMMV
the solution is very good
I got this issue and solved it by putting
#!/bin/sh
as the first line of the pre-commit file. YMMV
husky managed to run pre commit scripts without specifying this line. I have it like that in my newest project. But for some reason when I tried doing the same in one of my old ones I had to put this line you mentioned
Hi, 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:Thanks.