• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install Node.js on Linuxmint 20/19/18

Written by Rahul, Updated on January 19, 2021

Node.js is a platform built on Chrome’s V8 JavaScript engine.Nodejs can used for easily building fast, scalable network applications. Latest version node.js ppa is maintaining by its official website. Use this tutorial to install latest Nodejs & NPM on Linux Mint 19 and Linux Mint 18.

To install specific nodejs version, Visit our tutorial Install Specific Nodejs Version with NVM.

Install Nodejs on Linux Mint

Step 1 – Configure Node.js PPA

First of all, you need to node.js PPA in our system provides by Nodejs official website. We also need to install the python-software-properties package if not installed already. You can choose either to install the latest Node.js version or LTS version.

For Latest Release

sudo apt-get install curl python-software-properties software-properties-common
curl -sL https://deb.nodesource.com/setup_15.x | sudo bash -

For LTS Release

sudo apt-get install curl python-software-properties software-properties-common
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -

Step 2 – Install Node.js on Linux Mint

For this tutorial, I have added the latest release Apt repository on my Linux Mint system. NPM will also be installed with node.js. This command will also install many other dependent packages on your system.

sudo apt-get install nodejs

Step 3 – Check Node.js Version

After completing the installation process of node.js, Let’s check and verify the installed version. You can find more details about current version on node.js official website.

node -v 

v15.6.0

Also, check the version of NPM.

npm -v 

7.4.0
  • Don’t Miss => Yarn Installation ( A Node Modules Manager)

Step 4 – Create A Demo Web Server (Optional)

This is an optional step. If you want to test your node.js install. Let’s create a web server with “Hello World!” text. Create a file http_server.js

vim http_server.js

and add the following content

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(3000, "127.0.0.1");
console.log('Server running at http://127.0.0.1:3000/');

Now start the webserver using the command.

node http_server.js

Server running at http://127.0.0.1:3000/

Web server has been started on port 3000. Now access http://127.0.0.1:3000/ url in browser.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

22 Comments

  1. Avatar Jimster Reply
    October 23, 2020 at 3:20 pm

    Nice one ar kid.

  2. Avatar Daniel Twum Reply
    July 17, 2020 at 8:57 am

    For Linux Mint 20, this was what I had to do as a first step:

    sudo apt-get install curl software-properties-common

  3. Avatar Konrad Reply
    July 1, 2020 at 1:59 pm

    It is not working on Mint 20. It is still installing Node in version 10.19.0 without npm.

    • Rahul Rahul Reply
      July 2, 2020 at 7:26 am

      Hi Konrad, You can try with NVM : https://tecadmin.net/install-nodejs-with-nvm/

  4. Avatar Bruno Reply
    June 16, 2020 at 7:46 pm

    Very thanks!
    Your tutorial is complete.

  5. Avatar Ruslan Lozhkin Reply
    June 6, 2020 at 11:54 am

    Thank you. It’s a nice explanation and hello from Ukraine Kherson.

  6. Avatar Bryan Walls Reply
    May 6, 2020 at 9:19 pm

    When I tried to install on Mint 19.2 using setup_14.x, everything seemed to work. But I ended up with version 8.10.0. Trying to update says, “nodes is already the newest version (8.10.0-dfsg-2ubuntu0.4)”. What’s going on?

    • Avatar Bryan Walls Reply
      May 7, 2020 at 2:37 pm

      Figured out what was going on. I’m on a 32-bit Intel platform, and Node quit supporting 32-bit Linux. Was able to find an unsupported 12 version that’s working.

  7. Avatar Mike Rodent Reply
    September 16, 2019 at 11:26 pm

    Thanks… my experience may be unique, I don’t know. But I had to tweak you install script to get this to work.

    Specifically I had to comment out line 191 “exec_cmd ‘apt-get update'”. The reason being that this command produced some errors (three “E:…” output: 2 x “404” and 1 x “Some index files failed to download…”), and this apparently meant that your script didn’t continue. NB am a newb in scripts as well as Linux…

    Without commenting this line out the PPA does not get set up. Perhaps you might look into this and modify accordingly. Perhaps there’s no reason to include the “apt-get update” before you’ve actually installed the PPA?

  8. Avatar Marlon Baculio Reply
    August 3, 2019 at 10:25 pm

    To fix this error:

    # Your distribution, identified as “tina”, is not currently supported, please contact NodeSource …

    1. Put this URL in your browser: https://deb.nodesource.com/setup_10.x
    2. Copy the output script/text from that browser and write it to your own file like ~/setup_10.x
    3. In the middle of that file, look for the check_alt’s for Mint, then insert this line:

    check_alt “Linux Mint” “tina” “Ubuntu” “bionic”

    4. Save file then grant exec permission: chmod +x ~/setup_10.x
    5. Run: sudo ~/setup_10.x
    6. If no errors, proceed with: sudo apt-get install nodejs

    Good luck!

    • Avatar Sandy Reply
      August 12, 2019 at 11:10 pm

      Did the trick. Original article should be updated as it clearly doesn’t work on Mint 19.2

      Thanks again!!

      Sandy

    • Avatar Richard Thomas Reply
      October 31, 2019 at 3:06 am

      Thank you!

  9. Avatar xunorus Reply
    July 25, 2019 at 11:58 pm

    Your distribution, identified as “tina”, is not currently supported, please contact NodeSource ….

  10. Avatar Pablo Orellana Reply
    July 24, 2019 at 3:29 pm

    Your information have been very useful to me. I would ask you if you have a little project in nodejs where i can see html,css, javascript. Thanks in advance

  11. Avatar PatB Reply
    June 2, 2019 at 8:23 pm

    Thank you, this was a great help. Pat

  12. Avatar nemo Reply
    May 28, 2019 at 2:23 am

    Thanks so much.

  13. Avatar Steven Reply
    May 3, 2019 at 2:38 am

    Just what I needed. Thank you.

  14. Avatar Lawrence Reply
    April 29, 2019 at 8:23 am

    This helped me install nodejs on linux mint 18.3. Thank you very much.

  15. Avatar Benedict Reply
    January 21, 2019 at 11:57 am

    Thanks this works !!!

  16. Avatar Tony Reply
    November 21, 2018 at 1:57 am

    Thank you very much for this guide. Its spot on and has worked on so many different Linux based machines I have created. Figured it was time to finally say thank you for it!

  17. Avatar Vince Reply
    October 27, 2018 at 10:26 am

    The python-software-properties package doesn’t appear to be needed or used by Node.js. There’s no reason to install it.

    Your instructions for installing the “latest” version of Node.js are incorrect. That “10” is a version number, but the latest version is 11 (right now).

    The problem here is really with NodeSource. I wish they would create a /setup_latest path on their repository server. For that matter, I wish they would document the node package setup paths somewhere where I could find it instead of guessing that there must be a setup_11.x path because that’s the current version.

  18. Avatar Dana Reply
    October 3, 2018 at 11:54 am

    Thank you.This solved my Node.Js install problem on Linux Mint.I’m still a newbie.Thx again.

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy