How to Install Node.js on Windows (Complete Guide)

Node.js powers millions of web apps. Learn to install it on Windows using the official installer or NVM, verify npm, and create your first project.

How to Install Node.js on Windows (Complete Guide)
Install Node.js

Node.js lets you run JavaScript outside the browser — on servers, build tools, command-line apps, and more. npm (Node Package Manager), which comes bundled with Node.js, gives you access to over 2 million packages. Here is how to install it on Windows correctly.

Method 1: Install from nodejs.org (Best for Beginners)

1

Go to the official website

Visit nodejs.org. You will see two download options.

2

Download the LTS version

Click LTS (Long Term Support). This is the stable, recommended version. Only use “Current” if you need cutting-edge features for a specific project.

3

Run the installer

Run the downloaded .msi file. Accept all defaults. Make sure “Add to PATH” is selected. The installer also gives you the option to install build tools — accept this if you plan to build native modules.

4

Verify the installation

Open a new Command Prompt (must be fresh after installation) and run:

node --version
# Output: v20.11.0 (or similar)

npm --version
# Output: 10.2.4 (or similar)

Method 2: Install via NVM (Best for Developers)

NVM (Node Version Manager for Windows) lets you install and switch between multiple Node.js versions easily — essential when different projects require different versions.

1

Download NVM for Windows

Go to github.com/coreybutler/nvm-windows/releases and download nvm-setup.exe from the latest release.

2

Install NVM

Run the installer. After installation, open a new Command Prompt as Administrator.

3

Install Node.js via NVM

# Install the latest LTS version
nvm install lts

# Use it
nvm use lts

# See all installed versions
nvm list

# Switch to a specific version
nvm use 18.20.0

Step 3: Create Your First Node.js Project

# Create and enter a new project folder
mkdir my-app
cd my-app

# Initialize npm (creates package.json)
npm init -y

# Install a package (example: express web framework)
npm install express

# Create a simple server file (server.js):
# const express = require('express');
# const app = express();
# app.get('/', (req, res) => res.send('Hello World!'));
# app.listen(3000, () => console.log('Running on port 3000'));

# Run your server
node server.js

Open your browser and navigate to http://localhost:3000 — you should see “Hello World!”

Useful npm Commands

Use npx for tools

Use npx to run CLI tools without installing them globally. Example: npx create-react-app my-app creates a React project without needing react installed globally.

🔧

zSmartFix Editorial Team

Step-by-step technical guides tested on real hardware. Our guides are independently written and freely accessible to everyone.

Leave a Reply

Your email address will not be published. Required fields are marked *