---
title: "NPM on Windows: Your Complete Installation Guide for Node.js"
description: "Learn the ins-and-outs of NPM on Windows and take control of your Node.JS installation in this ATA Learning tutorial!"
canonical: "https://adamtheautomator.com/npm-on-windows/"
---

# NPM on Windows: Your Complete Installation Guide for Node.js

> Learn the ins-and-outs of NPM on Windows and take control of your Node.JS installation in this ATA Learning tutorial!

Source: https://adamtheautomator.com/npm-on-windows/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Install Node.js and NPM on Windows](https://adamtheautomator.com/wp-content/uploads/2023/09/npm-on-windows.jpg)

# How to Install Node.js and NPM on Windows

[![](https://secure.gravatar.com/avatar/2788bb1a3f735603f81eca51d68daec56a9d97e805a10268fb2c20afcc76b81b?s=192&d=mm&r=g)Nicholas Xuan Nguyen](https://adamtheautomator.com/author/nicholas-xuan-nguyen/)27 September 20237 min. read

Categories: [DevOps](/category/devops/)

Tags:[NodeJS](/tag/nodejs/)[Windows](/tag/windows/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing Node.js and NPM on Windows via a Node Installer](#installing-nodejs-and-npm-on-windows-via-a-node-installer)
*   [Installing Node.js and NPM via a Node Version Manager (NVM)](#installing-nodejs-and-npm-via-a-node-version-manager-nvm)
*   [Switching Between Different Node.js Versions via NVM](#switching-between-different-nodejs-versions-via-nvm)
*   [Testing the Node.js and NPM Installation](#testing-the-nodejs-and-npm-installation)
*   [Conclusion](#conclusion)

Are you looking for a fast and scalable JavaScript runtime environment for your applications? Node.js and NPM on Windows have become the go-to solutions for many developers, and you can get them installed on your machine in a heartbeat.

Installing this ultimate duo can feel like venturing into an unknown tech jungle. But in this tutorial, you will learn how to install Node.js and NPM. In time, you can dive into web development, creating cool apps, or building your own website.

Keep reading to build your full-stack applications more efficiently!

## Prerequisites

Before installing Node.js, ensure you have a 64-bit version of Windows installed with at least 4GB of RAM. This tutorial uses Windows 10 64-bit with 8GB of RAM for the demonstrations.

## Installing Node.js and NPM on Windows via a Node Installer

You have laid the foundation; it is time to catapult you into the exciting world of Node.js and NPM on Windows. But before diving in, you must first install Node.js and NPM.

In this example, you will use a Node Installer – a game-changer that simplifies the installation process.

To get Node.js and NPM running on your Windows machine, carry out these steps:

1\. Open your favorite web browser, navigate to the official [Node.js downloads page](https://nodejs.org/en/download), and download the Node.js Windows 64-bit Installer.

![Downloading the Node.js installer](https://adamtheautomator.com/wp-content/uploads/2023/09/image-132.png)

Downloading the Node.js installer

2\. Once downloaded, double-click the installer to start the installation process.

3\. Click **Next** on the Setup Wizard window that appears to continue with the installation.

![Continuing with the installation](https://adamtheautomator.com/wp-content/uploads/2023/09/image-131.png)

Continuing with the installation

4\. Now, tick the checkbox below and click **Next** to accept the license agreement.

![Accepting the license agreement](https://adamtheautomator.com/wp-content/uploads/2023/09/image-130.png)

Accepting the license agreement

5\. Choose where to install Node.js and NPM on your Windows machine, or keep the default location, and click **Next** to continue.

![Selecting the Node.js installation folder](https://adamtheautomator.com/wp-content/uploads/2023/09/image-129.png)

Selecting the Node.js installation folder

6\. Keep the default features as is (or customize as necessary), and click **Next** to continue.

This custom setup lets you choose which components of Node.js and NPM you want to install on your Windows machine.

![Selecting components to install](https://adamtheautomator.com/wp-content/uploads/2023/09/image-128.png)

Selecting components to install

7\. Tick the checkbox below, and click **Next**.

This option tells the Wizard to install the necessary dependencies for Node.js and NPM, such as Python, Visual C++ Build Tools, Chocolatey, etc.

Related:[How to Install Chocolatey and Get Started in No Time](https://adamtheautomator.com/install-chocolatey/)

![Setting the necessary tools to be installed automatically](https://adamtheautomator.com/wp-content/uploads/2023/09/image-127.png)

Setting the necessary tools to be installed automatically

8\. Click **Install** to start the installation process.

When you install Node.js, NPM is automatically included, simplifying the process of starting Node.js projects and leveraging the wealth of available packages and tools.

![Starting the Node.js installation](https://adamtheautomator.com/wp-content/uploads/2023/09/image-126.png)

Starting the Node.js installation

9\. Once installed, click **Finish** to close the setup wizard.

![Finishing the installation](https://adamtheautomator.com/wp-content/uploads/2023/09/image-125.png)

Finishing the installation

10\. During the installation process, allow all prompts in the PowerShell console that appear to install the required dependencies.

Node.js offers a large ecosystem of open-source libraries and packages available via NPM.

These packages provide pre-built solutions for various tasks, like building web servers, handling HTTP requests, working with databases, and more, helping to streamline development.

![Installing the required dependencies](https://adamtheautomator.com/wp-content/uploads/2023/09/image-124.png)

Installing the required dependencies

11\. Ultimately, open another PowerShell session and run the following commands to check Node.js and NPM versions installed on your system.

```powershell
# Checks Node.js version
node --version
# Checks NPM version
npm --version
```

The output below shows the installed versions of Node.js and NPM, which verify that both are installed correctly on your machine. You are now equipped to embark on full-stack application development using JavaScript!

![Checking the Node.js and NPM versions installed on the system](https://adamtheautomator.com/wp-content/uploads/2023/09/image-123.png)

Checking the Node.js and NPM versions installed on the system

## Installing Node.js and NPM via a Node Version Manager (NVM)

You have already learned how to install Node.js and NPM on Windows using a Node installer. But what if you are working on multiple JavaScript projects?

NVM is a more convenient option designed to simplify your computer’s management of Node.js and NVM versions. In a nutshell, NVM allows you to install and quickly switch between versions of Node.js and NPM.

To install Node.js and NPM via NVM, follow these steps:

1\. Visit the [GitHub repository](https://github.com/coreybutler/nvm-windows/releases) for NVM on your web browser and look for the latest version, which, at this time of writing, is v1.1.11.

![Visiting the GitHub repository for NVM](https://adamtheautomator.com/wp-content/uploads/2023/09/image-140.png)

Visiting the GitHub repository for NVM

2\. Scroll down and click the executable file, as shown below, to download the installer package (_**nvm-setup.exe**_)

![Downloading the NVM installer package](https://adamtheautomator.com/wp-content/uploads/2023/09/image-139.png)

Downloading the NVM installer package

3\. Once downloaded, double-click the Installer to start the installation process.

4\. On the **Setup** wizard, accept the license agreement and click **Next** to continue.

![Accepting the license agreement](https://adamtheautomator.com/wp-content/uploads/2023/09/image-138.png)

Accepting the license agreement

5\. Select a destination folder for the installation (or keep the default), and click **Next**.

![Selecting a destination folder for the installation](https://adamtheautomator.com/wp-content/uploads/2023/09/image-137.png)

Selecting a destination folder for the installation

6\. Select a destination folder for the Symlink (or keep the default), and click **Next**.

The symlink is a shortcut for NVM to access the necessary files to switch between different Node.js versions.

For instance, one project may require Node.js version 10, while another may need version 11. Uninstalling and reinstalling these versions every time you switch can be time-consuming, not to mention error-prone.

![Selecting a destination folder for the Symlink](https://adamtheautomator.com/wp-content/uploads/2023/09/image-136.png)

Selecting a destination folder for the Symlink

7\. Click **Install** to start the installation process.

![Starting the NVM installation process](https://adamtheautomator.com/wp-content/uploads/2023/09/image-135.png)

Starting the NVM installation process

8\. Once the installation completes, click **Finish** to close the setup wizard.

NVM has now been installed on your Windows machine, and you can begin managing different Node.js versions.

![Finishing the NVM installation](https://adamtheautomator.com/wp-content/uploads/2023/09/image-134.png)

Finishing the NVM installation

9\. Lastly, open PowerShell as administrator and run the following commands to install multiple Node.js versions using NVM:

Related:[Discover How to Run PowerShell as Administrator](https://adamtheautomator.com/powershell-run-as-administrator/)

*   `nvm install latest` – Fetches and installs the `latest` released version of Node.js from the Node.js distribution. This command ensures you are working with the latest features, improvements, and updates provided by the Node.js community. But beware, as it may contain experimental features or bugs.
*   `nvm install lts` – Installs the latest Long Term Support (LTS) version of Node.js. LTS versions are releases of Node.js that are actively maintained for 18 months from the date they become LTS. They are typically more stable and recommended for most users as they receive critical bug fixes and performance improvements.

```powershell
nvm install latest
nvm install lts
```

![Installing multiple Node.js versions via NVM](https://adamtheautomator.com/wp-content/uploads/2023/09/image-133.png)

Installing multiple Node.js versions via NVM

## Switching Between Different Node.js Versions via NVM

With Node.js and NPM set up, you can explore a genuinely dynamic feature – the ability to switch between different versions of Node.js effortlessly.

This feature ensures you can seamlessly adapt your development environment to the specific requirements of each project you are working on.

To switch between different Node.js via NVM, proceed with the following steps:

1\. Execute the following command to `list` all versions of Node.js installed on your Windows machine.

```powershell
nvm list
```

Pick one Node.js version you wish to switch to from the list of installed ones. Notice that version 18.17.1 is currently in use.

![Listing all installed Node.js versions](https://adamtheautomator.com/wp-content/uploads/2023/09/image-144.png)

Listing all installed Node.js versions

2\. Next, run the commands below to check the Node.js and NPM versions currently in use.

```powershell
node --version
npm --version
```

![](https://adamtheautomator.com/wp-content/uploads/2023/09/image-143.png)

3\. Once checked, execute the below command to switch (`use`) to a different installed Node.js version. Ensure you replace `<version>` with the version number you noted in step one.

```powershell
nvm use <version>
```

The below example switches to Node.js version **20.6.1**.

![Switching to Node.js version 20.6.1](https://adamtheautomator.com/wp-content/uploads/2023/09/image-142.png)

Switching to Node.js version 20.6.1

4\. Now, invoke the same commands from step two to verify you have successfully switched versions.

```powershell
node --version
npm --version
```

![Verifying successful Node.js version switch](https://adamtheautomator.com/wp-content/uploads/2023/09/image-141.png)

Verifying successful Node.js version switch

## Testing the Node.js and NPM Installation

Successfully switching between Node.js versions is a remarkable feat, but you must ensure everything runs as smoothly as silk by testing your Node.js and NPM installation.

In this example, you will create a small interactive JavaScript program where users can input two numbers, and the program will return the sum of those numbers.

To test your Node.js and NPM installation with a JavaScript program:

1\. Execute the following commands to create (`New-Item`) a `Directory` named `nvm-window-demo` and move into it.

You can change the directory path, as it will contain your project files.

```powershell
New-Item -ItemType Directory -Path C:\Users\admin\nvm-window-demo
cd C:\Users\admin\nvm-window-demo
```

Related:[A Beginners Guide To PowerShell New-Item](https://adamtheautomator.com/powershell-new-item/)

![Creating a project directory](https://adamtheautomator.com/wp-content/uploads/2023/09/image-149.png)

Creating a project directory

2\. Next, run the below command to initialize a new NPM project in your current working directory

```powershell
npm init -y
```

![Initializing a new NPM project ](https://adamtheautomator.com/wp-content/uploads/2023/09/image-148.png)

Initializing a new NPM project

Your _**nvm-window-demo**_ directory will look like the one below. A _**package.json**_ file is created in your project directory, which is used to manage your project’s dependencies and scripts.

![Viewing the nvm-window-demo directory](https://adamtheautomator.com/wp-content/uploads/2023/09/image-147.png)

Viewing the _nvm-window-demo_ directory

3\. Once initialized, run the command below to install a third-party package named `prompt-sync` and add it as a dependency in your _package.json_ file using NPM.

This package provides a way to synchronously prompt the user for input from the console.

```powershell
npm install prompt-sync
```

![Installing a third-party package named prompt-sync](https://adamtheautomator.com/wp-content/uploads/2023/09/image-146.png)

Installing a third-party package named prompt-sync

4\. Now, create a new JavaScript file named `addNumbers.js` in your preferred text editor, populate the following code, and save and close the file.

Related:[How to Edit Files with a Real PowerShell Text Editor](https://adamtheautomator.com/powershell-text-editor/)

This code uses the `prompt-sync` package to prompt the user to input two numbers consecutively and display their sum to the console.

```javascript
// Import the 'prompt-sync' library to get user input from the console
const prompt = require('prompt-sync')();

// Prompt the user to enter the first number and store it in the number1 variable
const number1 = prompt('Enter the first number: ');

// Prompt the user to enter the second number and store it in the number2 variable 
const number2 = prompt('Enter the second number: ');

// Parse the entered numbers as floats (decimal numbers)
const parsedNumber1 = parseFloat(number1);
const parsedNumber2 = parseFloat(number2);

// Calculate the sum of the two parsed numbers and store it in the sum variable
const sum = parsedNumber1 + parsedNumber2;

// Display the result to the console, including the input numbers and the sum
console.log(`The sum of ${number1} and ${number2} is ${sum}`);
```

> 💡 _Node.js is a JavaScript runtime, enabling the execution of JavaScript code on the server side rather than solely within web browsers. This capability empowers you to leverage the same language (JavaScript) for client and server-side development, streamlining the creation of full-stack applications._

5\. Finally, execute the following command to run your script (`addNumbers.js`) using Node.js (`node`).

```powershell
node .\addNumbers.js
```

Enter two random numbers when prompted, as shown below, and you will get the sum of those numbers.

If you see the identical output shown below, well done! This output signifies you have successfully installed Node.js and NPM on your Windows system.

![npm on windows - Running a JavaScript to test the Node.js and NPM installation](https://adamtheautomator.com/wp-content/uploads/2023/09/image-145.png)

Running a JavaScript to test the Node.js and NPM installation

## Conclusion

Congratulations, you have just unlocked a powerful gateway to modern web development by successfully installing [Node.js](https://adamtheautomator.com/https-nodejs/) and NPM on Windows! You have learned the ropes, from the Node installer method to the more advanced NVM for version control.

You have even flexed your skills by seamlessly switching between Node.js versions and confirming your setup with a nifty JavaScript program.

Now, why not further explore the power of Node.js by learning about its core concepts, such as [streams](https://nodejs.org/api/stream.html), [modules](https://www.w3schools.com/nodejs/nodejs_modules.asp), and [filesystems](https://nodejs.org/api/fs.html)? Keep coding, exploring, and, most importantly, keep building amazing things with Node.js and NPM. The digital world is yours to shape!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fnpm-on-windows%2F&text=How%20to%20Install%20Node.js%20and%20NPM%20on%20Windows)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fnpm-on-windows%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fnpm-on-windows%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2022/11/Install-NVM-on-Windows-and-Take-Control-of-Node-Versions.jpg)

### [Install NVM on Windows and Take Control of Node Versions](/install-nvm-on-windows/)

Easily learn to take control and switch between NodeJS versions and install NVM on Windows in this ATA Learning tutorial!

![](https://adamtheautomator.com/wp-content/uploads/2022/09/How-To-Install-And-Use-AWS-CLI-On-Windows.jpg)

### [How To Use and Install AWS CLI On Windows (The Perfect Way!)](/install-aws-cli-on-windows/)

With an AWS CLI install on Windows learn how to take advantage of command-line AWS functionality in this ATA Learning tutorial!

![](https://adamtheautomator.com/wp-content/uploads/2021/11/How-To-Use-Sets-in-Python.jpg)

### [How To Use Sets in Python](/sets-in-python/)

Learn how to use sets in Python to create, add, and manage data collections within code. Leverage data flexibility and learn to use sets in Python today!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
