2

For example I tried installing npm serve globally

$ npm install -g serve

but after seemingly successfully installing it, I was unable to run the serve executable. Seems like the command just could not be found. Turns out the exe serve file was located in:

usr/local/share/npm/bin 

rather than in what I thought should be (where all the other executable files are):

usr/local/bin

Any idea why I can't seem to get this to work?

DeliciousMe
  • 71
  • 10
  • 3
    Seems to be a common issue with users installing with homebrew. Some useful resources can be found [here](http://stackoverflow.com/questions/15170773/which-npm-bin-folders-should-be-in-the-path-os-x-10-8-2-npm-installed-wi), [here](http://stackoverflow.com/questions/14803978/npm-global-path-prefix) and [here](https://github.com/Homebrew/homebrew/issues/21627). – heyheyjp Feb 25 '14 at 06:00
  • @prattsj: +1 for links – Amol M Kulkarni Feb 25 '14 at 06:26

1 Answers1

3

Similar to this answer, create/edit ~/.npmrc to include:

prefix = /usr/local/bin
Community
  • 1
  • 1
Steve Jansen
  • 9,398
  • 2
  • 29
  • 34