In linux ubuntu command line, Run sudo apt update && sudo apt install nodejs npm to install it on machine.
How to Install Node Js and NPM Ubuntu 18.04/20.04/22.04
Steps to install js and npm in ubuntu 18.04/20.04/22.04 using command line or terminal:
Step 1: Update apt packages
before installing the Node js & NPM on Ubuntu. First update the apt package:
sudo apt-get update sudo apt-get upgrade
Step 2: Add Node.js PPA
PPA (Personal Package Archives) is Python software libraries. Before install node js & npm on ubuntu, first install PPA in our ubuntu system. Using this below commands.
sudo apt-get install python-software-properties
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
Step 3: Install Node.js and NPM On Ubuntu
After adding PPAs in our system. we need to run the below command for installing node js & npm on Ubuntu.
For Install Node js on Ubuntu :
sudo apt-get install nodejs
For Install NPM on Ubuntu
sudo apt-get install npm
Step 4: Test Version
After completing the installation process. We need to check the version.
Check the installed Node js version :
nodejs -v
Check the Installed NPM version :
npm -v
Conclusion
We have successfully installed Node js & NPM on Ubuntu 18.04/20.04/22.04. You are now ready to start deploying your applications and use Node js and NPM.
Recommended Node JS Tutorials
If you have any questions or thoughts to share, use the comment form below to reach us.
Well-written Article! Your article provides step-by-step information so that was easy to understand for beginners. so, thank you for this article and you have any tips and tricks about node.js then keep sharing.