shell commands of node modules not in path on MAX OSX

On Ubuntu, if I install a module like : npm install nodemon -g

I have the command nodemon in the $path

On Max OSX, nodemon is not in $path...

Any clues ?

UPDATE: there is nothing /usr/local/bin, I also tried same result with "npm install nodemon -g"

I had the same problem on my Mac. I was able to solve this by installing globally (no sudo required) and then adding /usr/local/share/npm/bin to my path. It's easy to put this in your bash profile so it gets added at startup. First, vim ~/.bash_profile, then:

export PATH=${PATH}:/usr/local/share/npm/bin

Then everything works as expected.

Incidentally, when I echo $PATH, /usr/local/bin is there, so it must be an issue with how npm works on Mac (that is, the global install location is different for Mac than Linux).

Try installing it globally:

sudo npm install nodemon -g

If that doesn't work either, add /usr/local/bin to your $PATH.

have you updated your terminal path since installing? Try closing and reopening your terminal. Are you using nvm (node version manager)? If so the binaries will be in something like

Users/maxl/.nvm/v0.10.4/bin

What is the output of

echo $PATH

I was stuck on this for a while. Then I discovered that the project I was working on had its own RVM gemset. The node module I was trying to install was npm install -g grunt-contrib-compass.

The result was that when I opened a new terminal window and ran which compass I would see the path, great! But after a cd to my project directory the path would be gone??? It turns out that NPM will install gems to RVM's (default) gemset! I tried to re-install without the -g flag and no luck.

My solution was a quick rvm --force gemset delete appname and just used the default for the project. Probably not ideal, but it worked. Hope this hint helps others.