1. Use homebrew install nvm
$ brew install nvm
$ brew --prefix nvm
$ echo ___/nvm.sh ~/.bash_profile
$ . ~/.bash_profile
2. Use nvm to install node.js
$ nvm ls-remote
$ nvm install v4.2.4
$ nvm use v4.2.4
$ nvm alias default v4.2.4
http://icarus4.logdown.com/posts/175092-nodejs-installation-guide