How to Install Node.js and NPM on Ubuntu 18.04

Node.js is one of the most popular web technologies to quickly build network applications, in this article, Thuthuat.taimienphi.vn will show you how to install Node.js and NPM on Ubuntu 18.04.

To install Node.js and NPM on Ubuntu 18.04, you need to add Node.js PPA to your Ubuntu 18.04 LTS , 16.04 LTS, 14.04 LTS system and install it. The same steps can be applied to any Debian-based distribution, including Kubuntu, Linux Mint, and Elementary OS.

Node.js is open source technology and compatible with many platforms. Node.js is used by many developers to increase the functionality of web applications. The main benefit of Node.js is that it is a server-side implementation, allowing JavaScript to operate without a client.
 

Article Table of Contents:
I. Node.js and NPM instructions on Ubuntu 18.04.
   1. Add Node.js from NodeSource.
2. Install Node.js on Ubuntu. 3. Check version. II. Uninstallation instructions.
   
   

I. Node.js and NPM tutorial on Ubuntu 18.04, Linux

There are many ways to install Node.js. However, thuthuat.taimienphi.vn will guide you in the simplest and most effective way. You can download the latest version of Node.js via .rpm, .dep and Snap packages.
 

1. Add Node.js from NodeSource

This is the simplest method to install a specific version of Node.js. You can quickly follow the steps below to install Node.js versions 13.x, 12.x, and 10.x.

First, you add the Node.js PPA to your system to install Node.js on Ubuntu.
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -

If you need to install any other version, then change the version number, such as 12.x, 10.x.
 

2. Install Node.js on Ubuntu

Picture 1 of How to Install Node.js and NPM on Ubuntu 18.04

Once the Node.js PPA has been activated, you install Node.js using the apt-get command. This will also install NPM with Node.js. At the same time, it will install many other dependent packages on your system.
sudo apt-get install -y nodejs
 

3. Check installed Node.js and NPM versions

Finally, Node.js and NPM have been successfully installed on the system. You can check and confirm the installed Node.js version using the following command:
node --version

Similarly, to check the NPM version, use the command:
npm --version
 

II. Instructions for uninstalling Node.js on Ubuntu

If you want to completely remove the Node.js and NPM packages from your system, just execute the following command:
sudo apt-get purge nodejs npm

Finally, run the command below to delete all unused files and free up storage space.
sudo apt-get autoremove


So, with just a few simple steps, you can successfully install Node.js and NPM on Ubuntu 18.04, and the article also provides you with an easy way to uninstall them if you don't need them. use. Please refer to How to install GIMP on Ubuntu 18.04 here to be able to use this photo editing software compared to Photoshop.

Update 16 June 2024
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile