Hi there, I recently ran in to an issue where my Sourcetree installation doesn't seem to find my NPM installation. When I try to commit some change (working with Sourcetree and Github) I will get the following error;
frontend/.husky/pre-commit: line 5: npm: command not found
husky - pre-commit hook exited with code 127 (error)
husky - command not found in PATH=/Library/Developer/CommandLineTools/usr/libexec/git-core:/Users/kevinmusters/Desktop/Sourcetree.app/Contents/Resources/bin:/usr/bin:/Users/kevinmusters/Desktop/Sourcetree.app/Contents/Resources/git_local/gitflow:/Users/kevinmusters/Desktop/Sourcetree.app/Contents/Resources/git_local/git-lfs:/usr/bin:/bin:/usr/sbin:/sbin
I have no idea why this error occurs and have already tried several potential fixes but nothing seems to work.
FYI;
1. I have NPM and Node installed,
npm -v; 10.9.0
node -v; v22.12.0
2. I've switched to System Git (2.39.5) which didn't fix it
3. I've added the PATH explicitly into the pre-commit file but also no fix.
Like to hear some more potential fixes. Thanks!
I reinstalled Sourcetree and my issue was resolved. I had previously been receiving this error:
.husky/pre-commit: line 1: npx: command not found husky - pre-commit script failed (code 127) husky - command not found in...
I've got a similiar error after a recent update and no memory of other changes on my end in the past couple of years.
Sourcetree Version 4.2.10 (269)
git --no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/bc/_l7x2w194sxd01j6fcd8nqlc0000gp/T/SourceTreeTemp.VdsTla
/Users/me/.git-global/hooks/pre-commit: line 4: grover: command not found
Completed with errors, see above
From my terminal:
% which grover
/usr/local/bin/grover
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.