Node.js Installation

Node.js Tutorial

Node.js Installation

Node.js Installation is mainly 3 ways:

  • Using Official Installer (Recommended)
  • Using Node Version Manager (NVM)
  •  Using Package Manager (Linux)

Below is the step-by-step guide.


1. Install Node.js on Windows (Recommended)

Step 1: Go to the official download page

👉 https://nodejs.org

Step 2: Download LTS (Recommended) version

Example:
Node.js 20.x LTS

Step 3: Run the Installer

Double-click the .msi file and follow the steps:

  • Accept license

  • Choose installation directory

  • Keep default settings

  • Install Node.js + npm

Step 4: Check installation

Open CMD or PowerShell:

node -v
npm -v

If these show versions, Node.js is installed successfully.


2. Install Node.js on macOS

Option 1: Official Installer

Download .pkg file from:

👉 https://nodejs.org

Then run the installer → next → next → finish.

Option 2: Install using Homebrew

brew install node

Check versions:

node -v
npm -v

3. Install Node.js on Linux (Ubuntu / Debian)

Update system:

sudo apt update

Install Node.js + npm:

sudo apt install nodejs npm -y

Check versions:

node -v
npm -v

4. (Optional but Recommended) Install Node Version Manager (NVM)

NVM lets you install and switch between multiple Node.js versions.

Install NVM (Linux/macOS):

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Restart terminal, then run:

nvm install --lts

Check version:

node -v

Install NVM for Windows

Download from:

👉 https://github.com/coreybutler/nvm-windows/releases

Then install Node.js using:

nvm install 20
nvm use 20

Verify Node.js Installation

Create a file:

test.js

Add:

console.log("Node.js is working!");

Run:

node test.js

If it prints the message — Node.js is successfully installed!

You may also like...