This post was written at a time when OS X Yosemite was prelease software and these instrutions may have changed since then.
The steps below are probably still relevant, although I'd like to see Node.js compiling without having to install the monolithic package that XCode is. In casse you know of a solution that allows us to compile Node using the Command Line Tools exclusively, please leave a message at the comments below. Thanks.
I've been using the new OS X prerelease for a while and yesterday I had the opportunity to reinstall the whole thing again instead of using an upgrade from Mavericks.
I had to also reinstall my toolset and I don't think I'm sharing secrets when I say that involved installing Node.js.
Brewing your Nodes
I'm using the brilliant Homebrew packaging system (I love it so much that I don't even know why one would use anything else to install software on their machines.)
The process is not too difficult, a bit of Googling helped me throughout the process but I thought I could help out others by summarizing what is currently involved in the process:
When the command line tools are not enough
First of all I'd like to tell you that seemingly the Command Line Tools are not going to be enough. I've tried this first and ended up having a compilation error. As it currently stands, the build patches that the Homebrew community provides does not work on Yosemite.
This means that we'd need to install the XCode Beta (Currently Beta 3) itself with all it's contents. I know it's a bit chunky with all its 5.5 gigabytes but look at the bright side: You get to play around with Apple's new programming language, Swift.
Anyway, so let's see what we need to do to get this working:
- Download the XCode beta from the Apple Development Site
- Run XCode to accept the License Agreement and let it automatically install components (this will enable you to use the compiler from the Terminal window)
brew install node
A couple of things to keep in mind:
The compilation issue has come up in the past and the Homebrew community have provided the necessary fixes. Chances are that this will get resolved pretty soon, so I encourage everybody to try letting your package manager sort things out first and then, and just after then if you are having issues try the instructions above.
I bet this will get resolved realy soon and Homebrew will have full support without the need of the whole XCode package.
I'm a Ruby/JS dev/trainer with a focus on quality. An ex-Londoner, @terracycle, @ubxd, @lastfm. Follow me at http://twitter.com/attilagyorffy