
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)
Go to the official website
Visit nodejs.org. You will see two download options.
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.
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.
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.
Download NVM for Windows
Go to github.com/coreybutler/nvm-windows/releases and download nvm-setup.exe from the latest release.
Install NVM
Run the installer. After installation, open a new Command Prompt as Administrator.
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
npm install package-name— Install a dependency and save to package.jsonnpm install -D package-name— Install as a development-only dependencynpm install— Install all dependencies listed in package.jsonnpm update— Update all packages to latest compatible versionsnpm run script-name— Run a script defined in package.json “scripts”npm uninstall package-name— Remove a packagenpx package-name— Run a package without installing globallynpm list— View all installed packages
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