Node.js
beginner
15 min
Installing Node.js
Learn about Installing Node.js in Node.js.
Installing Node.js
Node.js is a JavaScript runtime that lets you run JavaScript outside the browser. Before you can build backend applications, you need to install Node.js on your computer.
Installing on Windows
- Open your browser and go to nodejs.org.
- Click the green LTS (Long Term Support) button to download the installer. LTS is the stable version recommended for beginners.
- Run the downloaded
.msifile. - Click Next through the setup wizard. Keep the default options selected.
- When you reach the Tools for Native Modules screen, you can leave it unchecked.
- Click Install and wait for the installation to finish.
- Restart your terminal or command prompt.
Installing on Linux (Ubuntu / Debian)
- Open a terminal.
- Update your package list:
sudo apt update
- Install curl and software-properties-common:
sudo apt install -y curl software-properties-common
- Download and run the NodeSource setup script for the LTS version:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
- Install Node.js:
sudo apt install -y nodejs
- Verify the installation with:
node -v
andnpm -v
Installing on Linux (Fedora / RHEL)
- Open a terminal.
- Install Node.js and npm:
sudo dnf install -y nodejs npm
- Verify the installation with:
node -v
andnpm -v
Verify Installation
Open your terminal and run:
node -v npm -v
If you see version numbers, Node.js and npm are installed correctly.
Practice
Install Node.js on your computer and run the node -v command. Share the version number you see.