NodeJS on OS X Lion

By AJ O'Neal, published 2011-11-30

Don’t kid yourself into thinking that you should use a NodeJS pkg. That’s good enough for opening the REPL, but very quickly you’ll find that you need to do real development and that means you need real developer tools.

Pull up your britches on and get your Terminal on!

  1. Start your Terminal! (I recommend iTerm) and open the App Store

     open -a "App Store"
    
  2. Install the XCode Installer from the App Store (you’ll be waiting a few hours)

  3. Install XCode

     ⌘ [space] to bring up Spotlight
     Search for "XCode"
     Select "Install XCode"
     ⏎
    
     Click Click, blah blah
    
  4. Install and update Homebrew

     /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
     cd /usr/local
     git checkout master ./
     git pull origin master
    
  5. Install NodeJS

     brew install nodejs
     brew update nodejs
    
  6. Test

     node -e '0.1 + 0.2'
    

As long as you don’t end up with 0.3, you’ve probably got NodeJS installed correctly.

Code Well and Prosper

(function () {
  "use strict";
  // Always use strict mode.
  // Friends don't let friends code crap!
  
  // Don't ever use globals!
  // ...but if you do, do it right!
  var global = Function('return this')()
    , msg = 'Hello World!'
    ;
  
  console.log(msg);
}());

About the Author

Name:
AJ O'Neal
Location:
Provo, UT
Github:
coolaj86
Twitter:
coolaj86
Website:
http://coolaj86.info

NodeJS and ES5 JavaScript Developer. Friend to all.

About UtahJS.com

UtahJS is the website for the Utah JavaScript Users Group that meets to discuss and enjoy JavaScript!

JavaScript in the browser, on the server or just about anywhere else.

We love JavaScript but quite often talk about other topics such as CSS, HTML, cross browser coding, the internet… pretty much, anything that we find interesting.

Everyone is welcome. Please join us!