What Node.js is and why you might need it

Node.js is a tool that lets you run JavaScript code on your computer instead of only in a web browser. If you're a developer building web applications, working with certain frameworks, or running server-side code, you'll need Node.js installed. It also comes with npm (Node Package Manager), which handles software libraries your projects depend on.

Most people install Node.js because a project they're working on requires it, or because documentation for something they want to build says "install Node.js first." If you're not sure whether you need it, check the setup instructions for whatever you're trying to build.

Key Takeaways

  • Download the installer from nodejs.org — the LTS (Long Term Support) version is the safest choice for most people.
  • Run the installer and accept the default settings unless you have a specific reason to change them.
  • After installation finishes, verify it worked by opening Command Prompt and typing node --version.
  • Node.js and npm are installed together — you don't need to install npm separately.
  • If installation fails, restart your computer and try again, as Windows sometimes needs a restart to recognize new programs.

Downloading the Node.js installer

Go to nodejs.org in your web browser. You'll see two large download buttons near the top of the page. The left button is the LTS (Long Term Support) version, and the right button is the Current version. Choose LTS — it's more stable and gets security updates for longer, which is what most people need.

Click the LTS button. Windows will automatically detect your system and download the correct file (64-bit for most modern computers). The file will be named something like node-v20.10.0-x64.msi and will appear in your Downloads folder.

Running the installer and accepting defaults

Open your Downloads folder and double-click the Node.js installer file. Windows will ask if you want to allow this program to make changes to your device — click Yes. The Node.js Setup Wizard will open.

Click Next on the welcome screen. Read the license agreement, check the box that says you accept it, and click Next again. On the next screen, you'll see the destination folder — leave it as C:\Program Files\nodejs and click Next. The installer will then show you a list of features to install. Leave all checkboxes checked (this includes npm, which you need) and click Next.

The final screen offers to install tools for native modules. Unless you know you need this, leave it unchecked and click Next. Click Install on the summary screen. The installer will copy files to your computer — this usually takes less than a minute. When it finishes, click Finish.

Verifying the installation worked

Open Command Prompt by pressing Windows key + R, typing cmd, and pressing Enter. A black window will open. Type the following command and press Enter:

node --version

If the installation worked, you'll see a version number like v20.10.0. Now type this command and press Enter:

npm --version

You should see a version number like 10.2.3. If both commands show version numbers, Node.js and npm are installed and ready to use. Close Command Prompt by typing exit and pressing Enter.

What to do if the installer won't run or verification fails

If the installer won't open, your antivirus software might be blocking it. Temporarily disable your antivirus, run the installer, and re-enable it when finished. If you see an error during installation, restart your computer and try running the installer again — Windows sometimes needs a restart to finish setting up new programs.

If the version commands don't work after installation, restart your computer. Windows needs to update its list of programs and their locations, and a restart forces this to happen. After restarting, open Command Prompt again and try the version commands once more.

If you're still having trouble, uninstall Node.js completely. Go to Settings > Apps > Apps & features, search for "Node.js", click it, and select Uninstall. Follow the uninstall wizard, restart your computer, and download the installer fresh from nodejs.org.

Understanding what npm does

When you install Node.js, npm comes with it automatically. npm is a package manager — it downloads and installs code libraries that your projects need. When you're working on a project and the instructions say "run npm install," npm reads a file called package.json and downloads everything listed there.

You don't need to do anything special to use npm. It's already available in Command Prompt once Node.js is installed. Most of the time you'll use it by following instructions in a project's documentation, which will tell you exactly what npm commands to run.

Frequently Asked Questions

Do I need to restart Windows after installing Node.js?

Not always, but if the version commands don't work right after installation, restart your computer. Windows sometimes needs a restart to recognize new programs in Command Prompt. After restarting, open Command Prompt again and try the version commands.

Should I choose LTS or Current version?

Choose LTS (Long Term Support). It's more stable, gets security updates for longer, and works with almost all projects. The Current version has newer features but changes more often and is meant for developers testing new functionality.

What if I need to uninstall Node.js later?

Go to Settings > Apps > Apps & features, search for "Node.js", click it, and select Uninstall. Follow the uninstall wizard. This removes Node.js and npm completely from your computer.

Can I have multiple versions of Node.js installed at the same time?

The standard installer only lets you have one version at a time. If you need to switch between versions for different projects, you can use a tool called nvm-windows (Node Version Manager for Windows), but that's more advanced. For most people, one version is fine.

Why does the installer ask about native modules?

Native modules are code written in C++ that runs faster for certain tasks. Most projects don't need them. If a project requires native modules, its documentation will tell you to install build tools — you can always run the Node.js installer again and check that box later.