Installing NodeJS on Ubuntu 22.04
Overview
This is a simple step-by-step guide to install NodeJS on a Debian system.
Prerequisites
- A Debian server
- Sudo privileges
- An internet connection
Installation Steps
- Update and upgrade packages and install curl:
apt update && apt upgrade -y && apt install curl -y
- Download and execute the NodeJS installation script using
curl
:
NOTE: Replace <version> with your desired version, E.g: 20
curl -fsSL https://deb.nodesource.com/setup_<version>.x | sudo -E bash -
- Verify your installation. If done correctly, you will see something similar to:
~ node --version
> v20.3.1
~ npm --version
> 9.6.7
That's it, NodeJS is now installed :)