Install NPM and Node.js on Ubuntu 22.04 Example

10-Feb-2023

.

Admin

Install NPM and Node.js on Ubuntu 22.04 Example

Hi Guys,

This tutorial will give you example of How to Install Node Js & NPM Ubuntu 22.04?. We will use 4 Ways to Install Node.js & NPM on Ubuntu 22.04. I would like to share with you Install Node.JS and NPM from Ubuntu. let’s discuss about NodeJS and NPM installation in Ubuntu 22.04. Let's get started with Nodejs and NPM Proper Installation.

You can use this post for ubuntu 14.04, ubuntu 16.04, ubuntu 18.4, ubuntu 20.04, ubuntu 21 and ubuntu 22.04 versions.

Step 1: Install Node js & NPM on Ubuntu


To get this version, you can use the apt package manager. Refresh your local package index first by typing:

$ sudo apt update

Step 2: Add Node.js PPA

we will install the PPA in order to get access to its packages. From your home directory, use curl to retrieve the installation script for your preferred version, making sure to replace 16.x with your preferred version string

$ cd ~

$ curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh

Step 3: Now Install Node.js and NPM on Ubuntu

Type in the following code to begin the installation for Node.js

sudo apt install nodejs

Following code to begin the installation for NPM.

sudo apt install npm

Step 4: Test Version

Run the following command to verify the Node installation.

node -v

Verify the NPM installation.

npm -v

#Ubuntu