在pre-commit钩子中加入PATH变量解析 #!/bin/sh . "$(dirname "$0")/_/husky.sh" PATH="/usr/local/bin:$PATH" npm test