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!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events