Install Node.Js On Linux
Install Node.js on Linux
Akbar S. Ahmed | Jan 15, 2014

Step-by-step instructions

Installing Node.js on Ubuntu is exceptionally easy. We are going to install Node into our home directory so that we do not need to use sudo during development.

Create a directory structure to store locally installed packages.

mkdir -p ~/opt/packages && cd $_

Change the version numbers below as new versions of Node are released.

Download the node.js package.

wget http://nodejs.org/dist/v0.10.25/node-v0.10.25-linux-x64.tar.gz

Unzip the package.

gzip -dc node-v0.10.25-linux-x64.tar.gz | tar xf -

Create a symlink to the currently installed version. We can change the symlink in the future to easily upgrade our node version.

ln -s ~/opt/packages/node-v0.10.25-linux-x64/ ~/opt/node

Add node to your PATH.

vi ~/.profile

Write the following in your .profile file:

# include locally installed packages in PATH
if [ -d "$HOME/opt" ]; then
    PATH="$PATH:$HOME/opt/node/bin"
fi

Source your .profile file and test Node.

source ~/.profile

Ensure that the node command is in your PATH.

which node

Check the node version.

node --version

You should see: v0.10.25.

Check the npm version.

npm --version

You should see: 1.3.24.




Subscribe to our newsletter

Contact Information

ABOUT EXPONENTIAL.IO

We specialize in helping professional developers, like you, expand your skill set. Our courses are focused on enabling you to learn everything necessary to use a new technology in a live, production application.

LOCATION

All courses are made with love in
Palo Alto, CA.

Subscribe to our newsletter