How to Install Node.js on Windows: A Complete Setup Guide
Node.js is one of the most widely used JavaScript runtimes in modern web development. Whether you're running a local development server, building command-line tools, or working with frameworks like Express or Next.js, getting Node.js installed correctly on Windows is the essential first step. The process is straightforward — but the right approach depends on your workflow, Windows version, and how you plan to use Node.js over time.
What Is Node.js and Why Does the Installation Method Matter?
Node.js is a runtime environment that lets you execute JavaScript outside of a browser. It's built on Chrome's V8 engine and includes npm (Node Package Manager), which gives you access to hundreds of thousands of open-source packages.
On Windows, there isn't just one way to install it. You can use the official installer, a version manager, or a package manager like Winget. Each method produces a working installation — but they behave differently in practice, especially when you need to switch between Node.js versions for different projects.
Method 1: The Official Node.js Installer
The simplest path is downloading directly from nodejs.org.
Steps:
- Visit nodejs.org and choose between two release tracks:
- LTS (Long Term Support) — stable, recommended for most users
- Current — latest features, but less battle-tested
- Download the
.msiinstaller for Windows - Run the installer and follow the setup wizard
- Accept the license, choose your install directory, and ensure "Add to PATH" is selected
- Optionally install the Chocolatey package manager when prompted (useful for native module compilation)
- Open Command Prompt or PowerShell and verify:
node --version npm --version If both return version numbers, the installation succeeded.
This method is the lowest-friction starting point and works well for users who only need one Node.js version at a time.
Method 2: Using a Node Version Manager (nvm-windows)
nvm-windows is a separate tool — not the same as the Unix-based nvm — that lets you install and switch between multiple Node.js versions on one machine. 🔄
This matters more than it might seem. Real-world development often means working on one project that requires Node 18 and another that requires Node 20. Without a version manager, switching is manual and error-prone.
Steps:
- Download the latest
nvm-setup.exefrom the nvm-windows GitHub releases page - Run the installer (uninstall any existing Node.js installation first to avoid conflicts)
- Open PowerShell as Administrator and run:
nvm install lts nvm use lts - Verify with
node --versionandnpm --version
To install a specific version:
nvm install 20.11.0 nvm use 20.11.0 To list installed versions:
nvm list The tradeoff is a slightly more involved setup and the requirement to run certain commands with elevated permissions.
Method 3: Using Winget (Windows Package Manager)
If you're on Windows 10 (version 1809 or later) or Windows 11, Winget is built into the OS and lets you install Node.js from the terminal without visiting a browser.
winget install OpenJS.NodeJS.LTS This installs the LTS version. It's fast, scriptable, and integrates well with automated environment setups. The limitation is that it doesn't provide version-switching capabilities on its own.
What Gets Installed Alongside Node.js
Regardless of method, a standard Node.js installation includes:
| Component | Purpose |
|---|---|
| node.exe | The runtime itself |
| npm | Package manager for installing libraries |
| npx | Runs packages without installing them globally |
| PATH entry | Lets you run node and npm from any directory |
Some developers also install yarn or pnpm as npm alternatives after the initial setup, though npm works fine for most use cases out of the box.
Common Issues on Windows
"node is not recognized as an internal or external command" This usually means the PATH variable wasn't set correctly. Reinstalling with the official installer and ensuring "Add to PATH" is checked typically resolves it. A system restart or new terminal session may also be needed.
Permission errors when installing global packages On Windows, npm sometimes hits permission conflicts when installing packages globally. Running the terminal as Administrator resolves this in most cases, though configuring a custom global package directory is a cleaner long-term fix.
Conflicts between nvm-windows and a direct Node.js install If you previously installed Node.js directly and then install nvm-windows, version conflicts can occur. The nvm-windows documentation explicitly recommends uninstalling existing Node.js installations before setup.
Factors That Shape Your Setup Choice 🖥️
The right installation approach isn't the same for every user. Several variables influence which method fits best:
- How many projects you maintain — single-project users and hobbyists rarely need version switching; active developers often do
- Windows version — Winget availability depends on the OS build; older systems may need the manual installer
- Whether you use WSL — developers running the Windows Subsystem for Linux often manage Node.js inside the Linux environment rather than Windows directly, using the standard Unix
nvm - Team or organization requirements — some development environments specify exact Node versions via
.nvmrcfiles, which nvm-windows reads automatically - Comfort level with the command line — the GUI installer asks fewer questions; version managers require more terminal fluency
The technical steps for getting Node.js running on Windows are well-documented and consistent. Where it gets more nuanced is matching the installation method to how you actually work — and that part depends entirely on your own setup.