Error when trying to commit

Kevin Musters
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 3, 2025

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!

1 answer

0 votes
Ryan Dagg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 13, 2025

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

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events