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:

C:\Ruby200\bin;C:\Python27;C:\Program Files\nodejs;C:\Users\Predator\AppData\Roaming\npm

Edit:

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

grunt --version

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?

  • Fast Windows PHP editor with SVN and FTP support?
  • Cannot clone a git repository from github
  • Git: Internal error: refs/remotes/origin/master is not a valid packed reference
  • Git remote end hung up unexpectedly
  • Git pull error: unable to create file (Invalid argument)
  • git clone fails when destination is a network drive
  • Git push - select: Not enough memory
  • using git over ssh programmatically in C#
  • 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:

    echo $PATH
    

    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:

    echo $SHELL
    

    If you get something, then try running:

    $SHELL -l 
    

    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.

    Git Baby is a git and github fan, let's start git clone.