Ubuntu – How to install a Specific Version of Node on Ubuntu Server

16.04amazon ec2lubuntunodejsserver

I am trying to install Node 6.11.3 on my Ubuntu Server.
I don't want to use nvm for this.

I have already used this link but it just does not work out while using jenkins and stuff.

I want to specifically install NodeJS 6.11.3. How do I do that? Please help.

I tried this sudo apt-get install nodejs=6.11.3 but nothing happens.

Steps for NVM which I don't want to use

http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

Please bear with me. This is my first attempt on anything on server and also on askUbuntu.

Best Answer

Install nodejs 6

Get your nodejs tarball from node site e.g. node-v6.11.3-linux-x64.tar.gz from v6.11.3

wget https://nodejs.org/dist/v6.11.3/node-v6.11.3-linux-x64.tar.g‌​z

Unpack provided archive files to /opt/nodejs

mkdir -p /opt/nodejs
tar -xvzf node-v6.11.3-linux-x64.tar.gz -C /opt/nodejs/

Create link to current node version

cd /opt/nodejs
mv node-v6.11.3-linux-x64 6.11.3
ln -s 6.11.3 current

Create link to current node binary

ln -s /opt/nodejs/current/bin/node /bin/node

Verify Node version

node -v
v6.11.3 
Related Question