I have git bash open and I type in npm install
and then it returns:
bash: npm command not found
I don't understand, because I have node.js
command prompt and when I type in npm -v
then it returns 3.7.3
. How come it doesn't work in git?
I have git bash open and I type in npm install
and then it returns:
bash: npm command not found
I don't understand, because I have node.js
command prompt and when I type in npm -v
then it returns 3.7.3
. How come it doesn't work in git?
you need to add nodejs to your path, along with npm
If you are on Windows, try this: In CMD, go to folder
Then try the following
It works for me!
The terminal emulator installed by git is named Mintty. To run
npm
with Mintty, you need to add the path to an environment variable.Add the following line to your
~\.bash_profile
file. If it does not exist, create it.When Mintty starts up it will read
.bash_profile
. You should now be able to runnpm
from Mintty.These other questions might be helpful also.
https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path https://askubuntu.com/questions/58814/how-do-i-add-environment-variables
I had the same issue and I successed to solve it by changing the git enviornment system variable from C:\Program Files\Git\cmd to C:\Program Files\Git
Hope that will help someone
I had to add node path to system variable AND reboot. For some reason closing and reopening git bash was not enough
Are you on Windows?
If so, can you go to the Git Bash console and run:
and then check if the node path(e.g. c/Program Files/node ) is there?
If the node path is not there you'll need to add it to the system path variable.
If it's there, can you try to run npm between double quotes?