I\'ve created a very simple pre-commit script:-
#!/usr/bin/env sh # Run tests npm test if [ $? -ne 0 ]; then echo \"Tests failed. Aborting..\" exit 1 fi ex
Resolved. As globally installed node modules end up under /usr/local/bin I simply needed to add the following at the beginning of my pre-commit:
/usr/local/bin
PATH=$PATH:/usr/local/bin:/usr/local/sbin
i.e. appending both /usr/local/bin and /usr/local/sbin to PATH at the point of execution.
/usr/local/sbin
PATH