一、问题
在mac下使用sourcetree提交git时报错如下:
1 2 |
.husky/pre-commit: Line 4 npm: command not found .husky/_/husky.sh: line 23: sh: command not found |
二、解决
参考Husky/Command not found,~/.huskyrc
应该正确设置NVM:
1 2 3 4 |
# ~/.huskyrc # This loads nvm.sh and sets the correct PATH before running hook export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" |