+4 votes
590 views
in Linux/Unix by (242k points)
reopened
Install Node.js and NVM on Ubuntu 21.04

1 Answer

+5 votes
by (1.6m points)
 
Best answer

1. Install Node.js and NPM on Ubuntu 21.04 from the repositories
2 . Install Node.js and NPM on Ubuntu 21.04 from Snap

Node.js has been developed as a JavaScript runtime with an asynchronous event approach with which it is possible to create reliable and stable applications. Node.js can be run cross-platform and is open source for JavaScript, among its main features we find:

 

Node.js features

 

  • All APIs in the Node.js library are asynchronous
  • It is built in the Google Chrome JavaScript V8 engine, this allows the Node.js library to be fast in code execution
  • It has a single highly scalable thread
  • Does not have buffering

 

 

 

If your interest is to install Node.js and NPM in Ubuntu 21.04, getFastAnswer will explain the step by step for it..

 

To stay up to date, remember to subscribe to our YouTube channel!   SUBSCRIBE

 

 


1. Install Node.js and NPM on Ubuntu 21.04 from the repositories

 

Step 1

We access the terminal in Ubuntu 21.04 and download the repositories with the following command:
 curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - 
image

 

 

Step 2

Once this process is finished we will see the following. In this case we will see this message as it is a test distribution, but this still installs Node.js on Ubuntu 21.04. In this case we will see this message as it is a test distribution, but this still installs Node.js on Ubuntu 21.04.

 

image

 

 

Step 3

Now we proceed to install Node.js with the command.
 sudo apt install nodejs 
image

 

 

Step 4

We check the Nodejs version:
 node –version 
image

 

 

Step 5

Now we are going to install NPM with the command:
 sudo apt install npm 
image

 

 

Step 6

We enter the letter S to confirm the download and installation:

 

image

 

 

Step 7

We check the NPM version:
 npm –version 
image

 

 


2 . Install Node.js and NPM on Ubuntu 21.04 from Snap

 

Step 1

Another option to install Node.js and NPM in Ubuntu 21.04 is with the Snap package manager, for this we are going to use the following command:
 sudo snap install node --channel = 14 / stable –classic 
image

 

 

Step 2

We check the versions:
 node --version npm –version 
image

 

 

With either of these two methods we can install node.js and NPM in Ubuntu 21.04.

 


...