This tutorial will discuss the command line way to install Node.js and NPM quickly on Windows 10 or 11 using the PowerShell or Command prompt.
Although Node.js is cross-platform, its process of installation is different as per the operating system you are using. When it comes to Windows, most of the time users manually visit the website of Nodejs to download its executable file to perform the installation. However, you don’t need to do that because Windows 10 and 11 come with an inbuilt package manager like Linux known as Winget.
And in this article, we will provide a step-by-step guide to installing Node.js and NPM on Windows 10 or 11 using the command terminal.
Those who are not interested in the CLI way can still go for the traditional GUI way for downloading and installing Node.js and NPM on Windows 10 or 11.
Use CMD or Powershell to install Node.js & NPM on Windows 10 or 11
Prerequisites – Before installing Node.js and NPM on Windows, it is important to ensure that the following prerequisites are met:
- You are using Windows 10 or 11
- Access the Administrator user account
- Active Internet connection
1. Open PowerShell as Admin
Here we are using Powershell, however, you can use the Command prompt as well; the given steps in this article will be the same for both.
Right-click on the Windows 10 or 11 start menu and select Terminal (Admin) in Windows 11. Whereas Windows 10 users would have Powershell (Admin) option.
2. Check Winget is Available
Winget is a package manager developed by Microsoft for its Windows operating system to easily install an application using the command line. So, first, let’s check whether it is available on our system or not. Well, by default it will be there. if not, then you can install it manually from GitHub.
You will get something like the below in the given screenshot which confirms, the package manager is working fine.
3. Command to Install Node.js LTS or Current version
Node.js comes with NPM, so installing it will also configure the package manager. Som on your command prompt or terminal, type the given command to check the availability of Nodejs packages:
winget search node.js
You will see all the available versions of Node to install on Windows using the Winget package manager such as LTS, Current, and Nighlly.
Let’s see how to download them using the command given below, choose only one as per the version you want on your system.
For Node.js & NPM LTS version, the command will be:
winget install OpenJS.NodeJS.LTS
For Node.js and NPM Current version
winget install OpenJS.NodeJS
To get the Nightly version (testing)
winget install OpenJS.NodeJS.Nightly
4. Testing the Installation by checking the version
Once you are done with the installation, let’s confirm the required version of Node.js and NPM are on Windows by running a simple command in the command prompt or Powershell. However, before running them close and reopen the command prompt.
Check the version of Node.js by typing
Check the version of NPM by using
Does Windows 11 need an antivirus along with Windows Security?
8 Top Fastest Browsers to Use in India -2023
How to Generate Random and Placeholder Texts in Microsoft Word
Top 10+ Email Clients for Windows 11 or 10 – Free and Paid Apps
From Code to Content: 5 Uses of Text Editors in our daily work
How to find WSL home directory using Windows GUI?