How to Install Node.js and npm on Ubuntu 2020
Node.js is an open-source cross-platform JavaScript run-time environment that allows server-side execution of JavaScript code.
Npm is the package manager for Node.js. In this tutorial, I will show you how to install a different version of node js on ubuntu.
#Essential Tools
sudo apt-get install build-essential apt-transport-https curl#Installing Node.js and npm from Node Source
You can install any node js version by the setup_xx.x.
The command will add the Node Source signing key to your system, create an apt sources repository file, install all necessary packages and refresh the apt cache.
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash 
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash 
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash 
After that, you need to hit the following command.
sudo apt install nodejsFinally, you can check the node js and npm version by hitting the following commands.
node -v
npm -v 
                                 
                     
                                         
                                     
                                     
                                     
                                     
                                    
Leave Your Comment