Installing node and npm

Here is how to install node and npm in ubuntu.

The ~/local directory is to store all of your user-level packages, btw.

mkdir -p ~/local
mkdir -p ~/node-latest-install

cd ~/node-latest-install
curl | tar xz --strip-components=1

./configure --prefix=~/local   # if SSL support is not required, use --without-ssl
make install

cd ..
rm -rf ~/node-latest-install

Then in your ~/.bashrc file, append the following line.

export PATH=$PATH:'~/local/bin/'

Then source your new .bashrc by source ~/.bashrc

If everything goes well, the following commands should return the version info.

node -v
npm -v


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s