Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 1.4 KB

install-nodejs.md

File metadata and controls

72 lines (58 loc) · 1.4 KB

Install Node.js

Using package managers

Mac

brew install node

Ubuntu

sudo apt-get install nodejs npm

Using installer from website

Go 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.

Install curl if needed

# OSX
brew install curl
# Ubuntu
sudo apt-get update
sudo apt-get install curl

Download

curl -o master.zip https://codeload.github.com/visionmedia/n/zip/master

Extract it (if you didn't use git)

# Install unzip if needed like curl
unzip master.zip

Install build tools to get make (if necessary)

# OSX
xcode-select --install
# Ubuntu
sudo apt-get install build-essential

Install n in user space

cd n-master
mkdir $HOME/bin
PREFIX=$HOME make install

Set n environment variables

export N_PREFIX=$HOME
export PATH=$HOME/bin:$PATH
# Save them
echo 'export N_PREFIX=$HOME' >> ~/.profile
echo 'export PATH=$HOME/bin:$PATH' >> ~/.profile

Download and Install the latest stable version of Node.js

n stable