How to Install Node.js 12 on Linux Mint 20 Ulyana (Debian/Ubuntu Based Distributions)

5147
Share:
how-to-install-node-js-12-on-linux-mint-20-ulyana

About Node.js

Node.js is an open-source, cross-platform Javascript run-time environment that executes Javascript code outside the browser. Historically, Javascript was used primarily for client-side scripting, in which scripts written in JavaScript are embedded in a webpage's HTML and run client-side by a JavaScript engine in the user's web browser. Nowadays, Node.js represents a "JavaScript everywhere" paradigm, unifying web application development around a single programming language, rather than different languages for server side and client side scripts.

This guide should also works if you're using another Debian or Ubuntu based distributions.

Here's the list of supported Debian/Ubuntu based distributions:

  • Ubuntu 14.04 LTS (Trusty Tahr) - not available for Node.js 10 and later
  • Ubuntu 16.04 LTS (Xenial Xerus)
  • Ubuntu 18.04 LTS (Bionic Beaver)
  • Ubuntu 18.10 (Cosmic Cuttlefish)
  • Ubuntu 19.04 (Disco Dingo)
  • Ubuntu 19.10 (Eoan Ermine)
  • Ubuntu 20.04 LTS (Focal Fossa)
  • Debian 8 / oldoldstable (Jessie)
  • Debian 9 / oldstable (Stretch)
  • Debian 10 / stable (Buster)
  • Debian unstable (Sid)
  • Linux Mint 17 "Qiana" (via Ubuntu 14.04 LTS) - not available for Node.js 10 and later
  • Linux Mint 17.1 "Rebecca" (via Ubuntu 14.04 LTS) - not available for Node.js 10 and later
  • Linux Mint 17.2 "Rafaela" (via Ubuntu 14.04 LTS) - not available for Node.js 10 and later
  • Linux Mint 18 "Sarah" (via Ubuntu 16.04 LTS)
  • Linux Mint 18.1 "Serena" (via Ubuntu 16.04 LTS)
  • Linux Mint 18.2 "Sonya" (via Ubuntu 16.04 LTS)
  • Linux Mint 18.3 "Sylvia" (via Ubuntu 16.04 LTS)
  • Linux Mint Debian Edition (LMDE) 2 "Betsy" (via Debian 8)
  • Linux Mint 19 "Tara" (via Ubuntu 18.04 LTS)
  • Linux Mint 19.1 "Tessa" (via Ubuntu 18.04 LTS)
  • Linux Mint 19.2 "Tina" (via Ubuntu 18.04 LTS)
  • Linux Mint 19.3 "Tricia" (via Ubuntu 18.04 LTS)
  • Linux Mint 20 "Ulyana" (via Ubuntu 20.04 LTS)
  • Linux Mint Debian Edition (LMDE) 3 "Cindy" (via Debian 9)
  • Linux Mint Debian Edition (LMDE) 4 "Debbie" (via Debian 10)
  • Devuan Jessie / oldstable (via Debian 8)
  • Devuan Ascii / stable (via Debian 9)
  • Devuan Beowulf / testing (via Debian 10)
  • Devuan Ceres / unstable (via Debian unstable)
  • elementary OS Freya (via Ubuntu 14.04 LTS) - not available for Node.js 10 and later
  • elementary OS Loki (via Ubuntu 16.04 LTS)
  • elementary OS Juno (via Ubuntu 18.04 LTS)
  • elementary OS Hera (via Ubuntu 18.04 LTS)
  • Trisquel 7 "Belenos" (via Ubuntu 14.04 LTS) - not available for Node.js 10 and later
  • Trisquel 8 "Flidas" (via Ubuntu 16.04 LTS)
  • BOSS 5.0 "Anokha" (via Debian 7) - not available for Node.js 10 and later
  • BOSS 6.0 "Anoop" (via Debian 8)
  • BOSS 7.0 "Drishti" (via Debian 9)
  • BOSS 8.0 "Unnati" (via Debian 10)
  • MX-17 Horizon (via Debian 9)
  • MX-18 Continuum (via Debian 9)
  • MX-19 Patito Feo (via Debian 10)
  • BunsenLabs Hydrogen (via Debian 8)
  • BunsenLabs Helium (via Debian 9)
  • Sparky 4.x "Tyche" (via Debian 9)
  • Sparky 5.x "Nibiru" (via Debian 10)
  • PureOS 9.0 "Amber" (via Debian 10)
  • Astra Linux CE 2.12 "Orel" (via Debian 9)

 

Installation

Node.js is available from the NodeSource Debian and Ubuntu binary distributions repository. Support for this repository, along with its scripts, can be found on GitHub.

The latest Node.js version as the time of writing is 12.8.3 LTS and 14.8.0 Current.

To install Node.js version 12.8.3 LTS, enter these commands on your terminal:

$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt-get install -y nodejs

Alternatively, if you want to install Node.js 14.8.0 Current you could use these commands:

$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt-get install -y nodejs

To compile and install native addons from npm you may also need to install build tools:

$ sudo apt-get install -y build-essential

Verify Installation

Once the installation process finished, we need to verify it. To verify whether your installation is correct:

$ node --version
v12.8.3
$ npm --version
6.14.6

Optional: Update npm Version

npm is a separate project from Node.js, and tends to update more frequently. As a result, even if you’ve just downloaded Node.js (and therefore npm), you’ll probably need to update your npm. Luckily, npm knows how to update itself! To update your npm, type this into your terminal:

$ sudo npm install npm@latest -g
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
+ [email protected]
added 17 packages from 3 contributors, removed 18 packages and updated 20 packages in 11.293s

$ npm --version
6.14.8

Final Words

I hope that you now know how to install Node.js 12 LTS / 14 Current on Linux Mint 20 Ulyana. If you run into any issues or have any feedback feel free to drop a comment below.

Tags Nodejs
Share:

1 comment

  1. I have tried the method but I am only getting nodejs js version 10.x . I am using ulyana focal . also upadte the packages .

    • Hello Atik,

      Make sure you're typing this command correctly.

      $ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

Leave a reply

Your email address will not be published. Required fields are marked *