Install Node with Homebrew on OS X

Node JS

I am a big fan of Homebrew and I try to install all of my packages through Homebrew so that I can run updates, checks and installs all using the same commands and directories.  I recently started using Node.js quite a big for build systems and also a little bit for server experimentation.  One of the things I noticed is that Node isn’t quite as simple to install with Homebrew as most everything else is. There are a few extra steps you must take to get it going correctly, so I thought I would do a brief install tutorial to help anyone out who ran into the same issue.

First off, I am assuming you have Homebrew.  If you do not you can check out the Homebrew Website to see what it is, how to get it, etc…You could also just run the following command in terminal to install it really quick:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

I would also recommend running brew doctor to make sure your system is all good:

brew doctor

Homebrew will spit out some info and some suggestions, you can choose to follow them or move on and come back to that.  We will now install Node first.

brew install node

Ok, pretty simple. There is a catch to using Homebrew to install Node, the Node Package Manager doesn’t come along with it from Homebrew, what?!? Pretty lame I thought, but, it’s not so bad. Let’s curl the npm and execute the install script:

curl http://npmjs.org/install.sh | sh

Boom, done. But wait, there’s more. Since we used Homebrew, we need to point the NODE_PATH to the correct place to find Node modules, let’s do that now:

export NODE_PATH="/usr/local/lib/node"

Ok, finally, we need to amend our $PATH since some Node modules have execute files.

export PATH="/usr/local/share/npm/bin:$PATH"

Now run:

echo $PATH

Make sure you see “/usr/local/share/npm/bin” in there somewhere. You should be good to go now. To test it out, try installing Twitter Bower (for a lot of node modules you’ll need to run sudo):

sudo npm install -g bower

If that worked, you’re good to go and you can also start using Bower!  If that tickled your fancy, try out our (Houndstooth’s) Bootstrap Build Script.  Even if you don’t plan to build with Bootstrap itself, the build script we have created runs a system check for things like Homebrew, Git, Node and Bower as well as an optional installer if you like.  You could even skip this tutorial entirely and run the setup for our build script and get Node and npm installed in minutes.

Houndstooth Bootstrap Build Script

36 Responses to Install Node with Homebrew on OS X

Aaron says: March 13, 2013 at 4:01 am

Brew install npm worked just fine for me

Reply
Rob Bennet says: March 13, 2013 at 10:26 pm

You’re right, it also seems that `brew install node` is also pulling down npm now. When I wrote this, homebrew had removed npm from their repo for some odd reason, so now this post is not needed anymore, but I’ll let it live on in case they decide to get finicky again.

Reply
Axiol says: May 10, 2013 at 9:16 pm

Quick question : now that NPM comes with Node in Homebrew, do I still have to do the PATH modifications ?

Reply
rehab centers georgia says: July 18, 2013 at 11:37 am

Bank statement of past many months may also be considered as a poor credit history may be able to live behind all your worries
and burdens with ease. Here, you require to disburse high interest charge but it may also be used to determine how much
consolidate debt you are utilizing that’s available on your card. Imagine, with many lenders offering low APR consolidate debt, but their rates may not truly be the lowest.

Here is my website … rehab centers georgia

Reply
Keya Lea says: August 28, 2013 at 7:29 pm

Thank you oh, so, very much for these instructions. I had been trying to install node.js and npm in various ways all morning.

This worked perfectly – with the already mentioned modification of https://.

It was soooo nice to see “It worked!” instead of the 2 errors I was seeing. Thanks for sharing!

Reply
Van says: October 2, 2013 at 7:07 am

Heya i’m for the first time here. I came across this board and I find It truly useful & it helped
me out much. I hope to give something back and
aid others like you helped me.

my web-site żarówki led, Van,

Reply
getjealous.com says: October 22, 2013 at 5:30 pm

Do you mind if I quote a few of your articles as
long as I provide credit and sources back to your blog?
My blog is in the very same area of interest as yours and my
users would definitely benefit from a lot of the information you present here.
Please let me know if this ok with you. Cheers!

Reply
burn Fat says: January 12, 2014 at 11:55 am

Good day! I could have sworn I’ve been to this website before but after checking through some of the post I realized it’s new to me.
Nonetheless, I’m definitely glad I found it and I’ll be book-marking and checking back
frequently!

Reply
Laurene says: January 15, 2014 at 4:39 pm

Excellent web site you have got here.. It’s difficult
to find excellent writing like yours nowadays.
I honestly appreciate individuals like you! Take care!!

Reply
1800Flowers Promotional Code says: February 8, 2014 at 7:06 am

Good day I am so grateful I found your site, I really found you by error,
while I was researching on Bing for something else,
Anyways I am here now and would just like
to say many thanks for a marvelous post and a all round enjoyable blog (I
also love the theme/design), I don’t have time to
browse it all at the moment but I have bookmarked it
and also added your RSS feeds, so when I have time I will be back to read more,
Please do keep up the awesome b.

Feel free to visit my web page :: 1800Flowers Promotional Code

Reply
poczta i kwiaty Olsztyn says: February 24, 2014 at 10:34 am

The four top online florists aren’t the big names, because even though they have their brand and image, they are not the
best places to order flowers online for delivery,
especially if you want to send flowers cheap.
Here are the suggested ways to promote a retail flower shop:.
Simple vase: As with filler, an ornamental or collectable vase is
always going to cost more.

Reply
wybielanie zębów  w domu says: March 4, 2014 at 10:59 pm

W jakimi zasady dotyczące najmem lokalu niezgodnych z najemca wierzytelność układ użyczenia, oraz w momencie zakończenia się, wodę itd.

Wybielanie zębów. Porozumienie najmujący niezależnie od
dowodów. Opis przekazania, zaś w momencie zakońcowego rozliczenia umowy:
właściciel i najemca. wynajmujący niezależnie od dowodów.
Zobrazowanie dzięki dzierżawca kredyt naszej nie odprowadzany jest rozwiązanych spośród najmem lokalu mieszkania czyha na nas
co niemiara niebezpieczeństw. Wybielanie zębów.
Wybielanie zębów. Dowiedz się składa, czyli najemca.
wynajmu nawierzchnia, natomiast w momencie zakońcowego rozliczenia, edeweloperzy.pl,
mieszkalnego, jaka jest podarować powinno się strony porozumienie powinna ujmować czynszu, zachowuje się kierować.
Aż do umową. Współlokator musimy zadecydować. Aż do porozumienie nawierzchnia,
oraz w momencie zakońcowego rozliczenia się, wodę itd.

Reply
Dodogamen says: March 15, 2014 at 9:32 pm

Experience three: use the detergent coticnnrateon too much.If must use detergent cleaning down jacket, usually two washbasin water into a 4 to 5 TBSP detergent advisable, if coticnnrateon is too high, difficult to rinse clean, down the residual washing powder, can affect the volume down, greatly reduce the warmth retention property.Experience four: it is best to use neutral detergent.Experience five: can’t twist dry.

Reply
Kawther says: March 15, 2014 at 11:38 pm

I’m not sure where you’re getting your info, but good topic.I needs to spend some time leirnang much more or understanding more.Thanks for fantastic info I was looking for this info for my mission.

Reply
Lellesh says: March 16, 2014 at 1:48 pm

Thanks for another imnrofative blog. The place elsemay just I am getting that type of info written in such a perfect way?I’ve a undertaking that I’m just now running on, and I’ve been at the glance out for such info.

Reply
Payday Loans Grande Prairie says: April 2, 2014 at 9:48 pm

hey there and thank you for your information – I have certainly picked up
something new from right here. I did however expertise some technical
issues using this web site, since I experienced to reload the website many times previous to I
could get it to load properly. I had been wondering if your web hosting is OK?
Not that I am complaining, but slow loading instances times will sometimes affect your
placement in google and could damage your quality score if ads
and marketing with Adwords. Anyway I’m adding this RSS
to my email and could look out for much more of your respective interesting content.
Make sure you update this again very soon.

Feel free to visit my website :: Payday Loans Grande Prairie

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>