Quick Guide to getting node.js on mac 10.6
By Alex Kessinger on
Find me on: Google+, Twitter, and email
I have been searching for a full blown local JS enviroment to start playing around with different ideas about JS. Node seems to be that full fleshed environment, what I love is how easy it has been to install everything. It’s nothing like what it took to get started with things like PHP back in the day, it’s amazing to wonder how I ever made it over the learning hump in the beginning.
First install Homebrew, which is laughably easy, although make sure you understand what you are signing up for, then make sure you have XCode. XCode can be found on apples site, you need signup for there developer program.
// Run this command to install Homebrew
ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
Then do this
brew install node
Yep I am really not kidding, its that simple.
Now you have an awesome JS environment to play with. I would recommend installing some kind of node.js package manager. I first found Seed.js, but it seems like there servers are having problems. I then stumbled upon Kiwi. You can use Homebrew to install it.
brew install kiwi
Kiwi still seems a bit young, there are some rough edges. For instance I wanted to install the markdown parser so I could use it inside node, and I ran into an issue of Homebrew not putting libraries in normal places. So I had to install the Discount package using Homebrew.
brew install discount
Then I was able to use Kiwi to install markdown
kiwi install markdown
But, for some reason the resulting markdown.node module wasn’t getting put on my path, so I had to do that first.
ln -s /Users/alexkess/.kiwi/current/seeds/markdown/0.0.2/build/default/markdown.node /Users/alexkess/.node_libraries/markdown.node
And that was it I was able to then use the markdown module inside node.js
node
node> var md = require("markdown");
node> md.parse('markdown is *awesome*')
'<p>markdown is <em>awesome</em></p>'