Should you run into troubles with running libraries like NodeJS or PhantomJS installed with Brew, this might be the very process to get around it all. Specifically, those are the steps I recently followed to fix Node setup on my Mac.
Locate binary of the library
npm -v gets you
command not found.
$ brew info node
You should get something like this:
node: stable 0.10.29 (bottled), devel 0.11.13, HEAD http://nodejs.org/ /usr/local/Cellar/node/0.8.8 (1563 files, 19M) /usr/local/Cellar/node/0.10.17 (1093 files, 16M) Built from source /usr/local/Cellar/node/0.10.29 (1547 files, 18M) *
Dive into that folder with
cd /usr/local/Cellar/node/0.10.29 and check where the binary file is. I found mine in
Figure out your $PATH file configuration
$ echo $PATH
And you should get similar output:
/usr/local/bin exists, if not, create it:
$ mkdir -p /usr/local/bin
Link Node binary to a $PATH folder
$ ln -s /usr/local/Cellar/node/0.10.29/bin/node /usr/local/bin
Check if the link works with
which node and you should now see something like this:
Meaning we’re good and you are welcome.