brew install nodesudo apt-get install nodejs npmGo to http://nodejs.org and click install, then follow the instructions.
Using Node.js version manager n
Download n from the following url
https://github.com/visionmedia/n/archive/master.zip
Suggestion, use curl or simply git clone it.
# OSX
brew install curl
# Ubuntu
sudo apt-get update
sudo apt-get install curlcurl -o master.zip https://codeload.github.com/visionmedia/n/zip/master# Install unzip if needed like curl
unzip master.zip# OSX
xcode-select --install
# Ubuntu
sudo apt-get install build-essentialcd n-master
mkdir $HOME/bin
PREFIX=$HOME make installexport N_PREFIX=$HOME
export PATH=$HOME/bin:$PATH
# Save them
echo 'export N_PREFIX=$HOME' >> ~/.profile
echo 'export PATH=$HOME/bin:$PATH' >> ~/.profilen stable