Download and run the Windows installer
The fastest way to install Node.js on Windows is to download the installer from nodejs.org, run it, and follow the prompts. Node.js provides two versions: the LTS (Long Term Support) release, which receives updates for three years and is best for production work, and the Current release, which has the newest features but changes every six months.
Go to nodejs.org, click the large download button for Windows, and save the .msi file. Double-click it to start the installer. You will see a setup wizard that walks you through choosing an install location (the default C:\Program Files\nodejs works for most people), selecting which components to install, and confirming the installation. The installer will also add Node.js to your system PATH automatically, which means you can run Node.js commands from any folder in Command Prompt or PowerShell.
The entire process takes about two minutes. When it finishes, close the installer and restart your computer to make sure the PATH changes take effect.
Key Takeaways
- Download the LTS version from nodejs.org unless you need the newest features, because LTS releases receive updates for three years.
- The Windows installer automatically adds Node.js to your system PATH, so you can run node commands from any folder without extra setup.
- Verify the installation by opening Command Prompt or PowerShell and typing node -v and npm -v to see the version numbers.
- If you work with multiple projects that need different Node.js versions, use nvm-windows (Node Version Manager for Windows) to switch between them.
Verify the installation worked
After restarting, open Command Prompt or PowerShell and type node -v. You should see a version number like v18.17.0 or v20.9.0. Then type npm -v to check that npm (Node Package Manager, which installs code libraries) is also working. You should see a version number like 9.6.7 or 10.1.0.
If you see "node is not recognized" or "npm is not recognized", the PATH did not update correctly. Restart your computer again, or manually add Node.js to your PATH by opening System Properties, clicking Environment Variables, and adding C:\Program Files\nodejs to the PATH list.
Test Node.js with a simple program
Create a new folder for your first project. Open Command Prompt, navigate to that folder, and create a file called app.js with a text editor. Type this code into it:
console.log("Node.js is working");
Save the file, then in Command Prompt type node app.js. You should see "Node.js is working" printed to the screen. This confirms that Node.js can read and run JavaScript files on your computer.
Install packages with npm
npm comes with Node.js and lets you download code libraries that other developers have written. When you are in a project folder, type npm init to create a package.json file, which tracks which libraries your project uses. Then type npm install followed by the library name — for example, npm install express installs the Express web framework.
npm downloads the library and all its dependencies into a folder called node_modules. The package.json file keeps a record of what you installed, so if you share your project with someone else, they can type npm install and get the same libraries without you having to send them the node_modules folder.
Use nvm-windows if you need multiple Node.js versions
Some projects require a specific version of Node.js, and switching between them by uninstalling and reinstalling is slow. nvm-windows (Node Version Manager for Windows) lets you install multiple versions and switch between them with a single command.
Download the nvm-windows installer from github.com/coreybutler/nvm-windows, run it, and follow the setup wizard. Then open a new Command Prompt and type nvm install 18.17.0 to install a specific version, or nvm use 18.17.0 to switch to it. Type nvm list to see all installed versions. This is most useful if you work on multiple projects that were built for different Node.js releases.
Uninstall Node.js if you need to start over
If something goes wrong or you want to remove Node.js, open Control Panel, click Programs and Features, find Node.js in the list, and click Uninstall. Follow the prompts to remove it completely. If you installed nvm-windows, uninstall that separately the same way.
After uninstalling, restart your computer and delete the C:\Program Files\nodejs folder if it still exists. You can then download and install Node.js again from scratch.
Frequently Asked Questions
Do I need to restart my computer after installing Node.js?
Yes. The installer adds Node.js to your system PATH, and Windows does not always recognize PATH changes until you restart. If you skip the restart and get "node is not recognized" errors, restarting will usually fix it.
What is the difference between LTS and Current versions?
LTS (Long Term Support) versions receive bug fixes and security updates for three years and are best for production code that needs to stay stable. Current versions have the newest features but change every six months. For learning or new projects, either works, but LTS is safer for work that other people depend on.
Can I have multiple versions of Node.js installed at the same time?
The standard installer only keeps one version at a time. If you need to switch between versions for different projects, install nvm-windows, which lets you have multiple versions installed and switch between them with a command.
What should I do if the installer fails or hangs?
Close the installer, restart your computer, and try again. If it fails a second time, uninstall any existing Node.js version through Control Panel, delete C:\Program Files\nodejs if it exists, restart, and download the installer again from nodejs.org.
Do I need to do anything special to use Node.js on a network?
Node.js itself does not care whether your computer is on a network. If you are building a web server or application that other computers will connect to, you will need to configure your firewall to allow incoming connections on the port your application uses, and make sure other computers can reach your machine by IP address or hostname.