Setting up Node.js on Windows
This blog will help you install Node.js on a windows system.
There are some prerequisites for the installation of Node.js on windows.
- A user account with administrator privileges so that you may easily download and install the software.
- Access to the windows command line or Windows PowerShell in administrator mode.
How to install Node.js on Windows
The first step in using Node.js is the installation of Node.js libraries on the client system. Follow these steps to install Node.js in windows:
Step 1) Download the Node.js installer for Windows.
In the web browser, navigate to the https://nodejs.org/en/download/, click the windows installer button to download the latest stable version.
Note that the Node.js installer includes the NPM package manager.
The difference between the LTS and Current is LTS is the latest stable version of Node.js while Current is the latest version which may or may not be stable; if you don't have any specific needs, it is always recommended to download the LTS.
Click on the download; the installer will ask you the location where you want to download.
Step 2) Run the installer.
You need to double click on the downloaded .msi file to start the installation, click the run button on the first screen to start the installation process.
Click on the Next button to continue with the installation process.
Step 3) Continue with the installation steps.Review and Accept the terms and conditions and click on the Next button.
Step 4) The installer will prompt you for the installation location.
It is recommended to leave the default settings unless you have a specific need to install it somewhere else; click on Next.
The default installation location is C:\Program Files\node.js\; you may change it by clicking on the Change button.
Step 5) The installer will prompt you to select the components to include or remove from the installation.
Unless you have a specific need, it is recommended to leave it by default. Click on the Next button.
Step 6) Start the installation process.
Step 7) Complete the installation process by clicking on the Finish button.
If everything went well, Node.js is now successfully installed on your system.
Verifying Node.js Installation
Open a command prompt or Powershell and run the following command.
The system will display the node.js version installed in your system.
The NPM version can also be checked in a similar manner using the command
Updating Node.js on Windows
The first possible way to update Node.js is to download the latest version of Node.js from the official website by following the same instructions given above. Your system will automatically overwrite the older version, however, sometimes, the older version is not overwritten, and you may end up with two versions of Node.js.
To solve this problem, it is recommended to update Node.js with NPM.
- Before updating with NPM, check which version you are currently using by the command node -v.
2. Clear the npm cache with the command.
npm cache clean -f
3. Install n globally
npm install -g n
4. You can now use n to install the latest stable release of Node.js using the below command.
sudo n stable
Uninstall Node.js on Windows
To uninstall Node.js, follow the following steps:
- Click the start button, go to settings, and then Apps.
- Scroll down to Node.js. Click on Node.js
- Select Uninstall. A wizard will appear to uninstall the software.
Frequently Asked Questions
- How to set up Node.js on Windows?
You can download the latest version of Node.js from the official website.
Refer to the above article for more information.
- What is Node.js?
This blog discussed Setting Node.js in Windows. You may refer to our blogs for web technologies for getting started with web development.
A common problem faced by all of us is that we prepare well, but we cannot solve the questions on time during online assessments. To overcome this, Coding Ninjas have come up with an online mock test series. The mock tests for leading companies like Amazon, Microsoft, Google, Adobe, Flipkart, TCS, Wipro, and Accenture are free. Our team of experts has curated and designed these online mock test series to help you prepare better for your coding interview rounds. In this online test series, you will get multiple tests that include the latest coding interview questions. Start preparing for the 2021 Amazon, Microsoft, etc., tech interviews now.