May 2, 2024

How to Install Node.js and NPM on Ubuntu

To install nodejs and npm on your machine, please follow these steps:

Installing NodeJs from node source

Node.js package is available in the LTS and current release. According to your needs, you can select which version you would like to install. We’ll install Nodejs 22 which is the current version.

sudo apt-get install curl

curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash -

sudo apt-get install nodejs

Check NodeJs and NPM Version:

node -v
# v22.0.0

npm -v
# 10.5.1