Chris Hager
Programming, Technology & More

How to install NodeJS 6.x Long-Term Support (LTS) on Ubuntu/Debian and CentOS

NodeJS 6.x is the current NodeJS long-term support (LTS) release, with NodeJS v6.9.4 being the most recent release as of time of writing. This guide shows a quick and reliable way to install the current NodeJS 6.x LTS version (including npm) on Ubuntu/Debian and CentOS.

console.log("Hello World");

We will use the system package manager (eg. apt or yum) to install NodeJS 6.x, to be able to continually receive security updates without risking a major version jump with possibly breaking changes.

You can jump directly to the installation instructions here:


About NodeJS Long-Term Support (LTS)

Every major version covered by the LTS plan will be actively maintained for a period of 18 months from the date it enters LTS coverage. Following those 18 months of active support, the major version will transition into “maintenance” mode for 12 additional months.

via https://github.com/nodejs/LTS#lts-schedule


NodeJS LTS Schedule

NodeJS 6 LTS will be actively maintained until April 2018, and passively maintained until April 2019, as shown in the image above. It is recommended to use the long-term support version for client projects, in order to be guaranteed a long active maintenance with security updates..


Installing NodeJS 6.x LTS on Ubuntu and Debian

This is the official way to install NodeJS 6.x on Ubuntu, Debian, Linux Mint, Linux Mint Debian Edition (LMDE) and elementaryOS:

# Install NodeJS 6.x repository
curl -sL https://deb.nodesource.com/setup_6.x | bash -

# Install NodeJS and npm
apt-get install -y nodejs

The setup_6.x bash script basically just checks whether your operating system version is suppored and adds the corresponding repository (eg. https://deb.nodesource.com/node_6.x xenial InRelease).


Installing NodeJS 6.x LTS on CentOS 7

NodeJS provides a script for CentOS/Fedora/RHEL based distributions, which checks your operating system and adds the corresponding RPM repository for yum, the standard package manager:

# Install NodeJS 6.x repository
curl -sL https://rpm.nodesource.com/setup_6.x | bash -

# Install NodeJS and npm
yum install nodejs

The content of the script can be found here: https://rpm.nodesource.com/setup_6.x.


For feedback, ideas and recommendations, contact me on Twitter.

See also:



Share this post if you like it <3
swirl

Posted by Chris Hager in #nodejs  ·  12 Jan 2017


swirl