fatal: cannot run .husky/pre-commit: No such file or directory

一、问题

使用husky运行npm run commit时报错:fatal: cannot run .husky/pre-commit: No such file or directory

npm run commit

二、解决

将pre-commit页面换行符由CRLF换成LF即可!!

原来都正常,还以为是换了mac的问题,很无奈。

三、参考

https://github.com/conventional-changelog/standard-version/issues/254#issuecomment-424669323

https://github.com/conventional-changelog/standard-version/issues/254#issuecomment-424669323

Cannot spawn .husky/pre-commit: No such file or directory