How to install a Specific Version of Node on Ubuntu Server

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

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

4 Answers

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 

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 
13

Node.js is available as a snap package in all currently supported versions of Ubuntu. Specific to Node.js, developers can choose from one or more of the currently supported releases and get regular automatic updates directly from NodeSource. Node.js versions 6, 8, 9, 10, 11, 13, 14, 15, 16, 17 and 18 are currently available, with the Snap Store being updated within hours or minutes of a Node.js release.

Node can be installed with a single command, for example:

sudo snap install node --classic --channel 11/stable 

The node snap can be accessed by the command node, for example:

$ node -v
v11.5.0

An up-to-date version of npm will installed as part of the node snap. npm should be run outside of the node repl, in your normal shell. After installing the node snap run the following command to enable npm update checking:

sudo chown -R $USER:$(id -gn $USER) /home/your-username/.config

Replace your-username in the above command with your own username. Then run npm -v to check if the version of npm is up-to-date. As an example I checked that npm was up-to-date, checked the version of an already installed package named yarn with the command npm list yarn and then updated the existing yarn package to the latest version with the command npm update yarn

Users can switch between versions of Node.js at any time without needing to involve additional tools like nvm (Node Version Manager), for example:

sudo snap refresh node --channel=10/stable

Users can test bleeding-edge versions of Node.js that can be installed from the latest edge channel by switching with:

sudo snap switch node --edge

This approach is only recommended for those users who are willing to participate in testing and bug reporting upstream.

Node.js LTS schedule

ReleaseStatusCodenameInitial releaseLTS StartMaintenance StartMaintenance End
6.xEOLBoron2016-04-262016-10-182018-04-302019-04-30
7.xEOL2017-05-302017-06-30
8.xEOLCarbon2016-10-252017-10-312019-01-012019-12-31
9.xEOL2017-10-012018-06-30
10.xEOLDubnium2018-04-242018-10-302020-05-192021-04-30
11.xEOL2018-10-232019-06-01
12.xMaintenance LTSErbium2019-04-232019-10-212020-11-3012022-04-30
13.xEOL2019-10-222020-06-01
14.xMaintenance LTSFermium2020-04-212020-10-272021-10-302023-04-30
16.xActive LTSGallium2021-04-202021-10-262022-10-182024-04-30
17.xCurrent2021-10-192022-04-012022-06-01
18.xCurrent2022-04-192022-10-252023-10-182025-04-30

Nodejs provides an official wiki for the Installation process, that wiki is recently updated on 10-Nov-2018. @storm 's answer was useful when there was no document available.

This link is more about installing Node.js via binary archive on Linux

You can download the binary archive from here.

2

You can use the n for node's version managements

$ npm install -g n
$ n 6.11.3

Then you can check the version

$ node -v
$ v6.11.3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like