环境:Mac + nvm。
问题 1:The '.husky/pre-commit' hook was ignored because it's not set as executable.
解决:
// package.json 文件
{
"scripts": {
"prepare": "husky install | chmod ug+x .husky/*",
},
}
问题 2:git commit 时,报错 Git: .husky/pre-commit: line 8: pnpm: command not found.
解决:
# 终端输入下方命令,然后重启电脑。
sudo launchctl config user path `echo $PATH`