如果在 git GUI 软件, 例如sourcetree遇到 pre-commit / pre-push 报错找不到 yarn,可以参考这个 husky 的官方方案: https://github.com/typicode/husky/issues/390#issuecomment-1082345670
Solution
- Create
~/.huskyrcfile in my home directory - With this content:
如果使用nvm来管理node版本:
1 | # Load Yarn command coming from homebrew |
或者制定node版本:
1 | export PATH="/opt/homebrew/bin/: $PATH" |