Git Bash command not found after installing a package
I’m using msysgit on Windows, whenever I install something i.e. Node.js or a package via NPM I always get command not found until the system is rebooted. Even closing git bash and reopening I have the same issue. I’ve set environment paths for npm and node:
- TortoiseSVN icons not showing up under Windows 7
- How to set Araxis as diff / merge tool for MSYS git?
- How do I get git to stop changing newlines in my files?
- How to start jenkins on different port rather than 8080 using command prompt in Windows?
- How to create a git repository on a shared windows machine which all developers can push to
- Git Status Takes a Long Time to Complete
For example using Git Bash window I have Node.Js and NPM installed. I want to install a package globally so run:
npm install grunt -g
Grunt then installs globally, I then check grunt is installed by running
Error produced is:
sh: grunt: command not found
This happens with all NPM packages, it even happened with node.js and npm when I installed them. How can I restart Git Bash to take into account the newly installed packages?
One Solution collect form web for “Git Bash command not found after installing a package”
To add say
C:\Program Files\nodejs to the path inside the shell, you would issue:
PATH="C:/Program\ Files/nodejs;$PATH" export PATH
in some shells you can combine those two commands in one:
export PATH="C:/Program\ Files/nodejs;$PATH"
to look to see what folders are currently searched:
You may be able to get the shell to reread the environment giving the
-l option when you run the shell. See what your shell is by running:
If you get something, then try running:
which starts another login shell. However better is to use:
exec $SHELL -l
which starts a new shell replacing the old one. Without “exec” you’ll have the new shell nested inside the old one, which might not be so bad.