How to Install Node.js and NPM on Windows?

Photo of author

By Sameeksha Medewar

Node.js and NPM are two of the core components you’ll need to start building applications with JavaScript. They are easily available for download and you can follow this guide to install both Node.js and NPM on your Windows PC with ease.

What are Node.js and NPM?

If you’re a programmer who uses JavaScript, you would know that Node.js is a run-time environment that is used in the execution of server-side scripts or code written in JavaScript. It is Node.js which makes it possible for JavaScript to be used in server-side development and also assists in testing the JS scripts.

On the other hand, Node Package Manager, aka NPM, is a package manager that allows you to manage different software packages and dependencies of a JS project.

If you are a backend or full-stack JavaScript developer, you’ll need both Node.js and NPM for developing dynamic websites and web applications. If you are working on a Windows system, you can easily install Node.js and NPM by following some simple steps that we will be discussing in the next section. But before that, make sure that your user account has administrator privileges enabled. Also, you will need access to the Windows command line.

How to Download Node.js and NPM?

Here are 3 easy steps that will allow you to download Node.js and NPM on your system:

  • Step 1: Open a web browser and visit https://nodejs.org/en/download/.
  • Step 2: Click on the Windows Installer button under the LTS section, and it will start downloading the latest version of Node.js.

Note – Node. Js installer also comes with the NPM manager.

  • Step 3: Make sure your windows system is compatible with the latest version that you have downloaded. If the installer doesn’t work on your system, you may need to choose and download an older version of Node.js from here.

How to Install Node.js and NPM?

After downloading the Node.js installer, it’s time to install Node.js along with NPM on your Windows system. Below are the steps that you need to follow to achieve the same:

  • Step 1: Click on the “Downloads” option on your browser. There you’ll see the Node.js and NPM installer, launch it.
  • Step 2: A pop-up window will ask you to run the software. Click on “Run”.
  • Step 3: The Node.js Setup wizard will welcome you. Click on “Next”. On the next screen, you’ll see the license agreement. Click “Next” again after agreeing to the terms and conditions of the software.
  • Step 4: The installer will ask you to select a specific installation location. Unless you want to install it somewhere else, proceed with the default installation location by clicking on the “Next” button.
  • Step 5: Proceed with the default options shown on the next wizard screen unless you have some specific needs. Click the “Next” button.
  • Step 6: Now, click the install button. The installation process will begin and after it gets completed, click the Finish button.

How to Verify the Installation?

Verifying whether the software has been installed properly or not is extremely important. This is how you can verify the installation of Node.js and NPM on your system.

Open the command prompt, and run the following command to check if Node.js has been installed successfully on your system:

node –v

At the output, you will be able to see the version of the Node.js that you’ve installed. In case the command prompt fails to recognize the command specified above, it means that Node.js hasn’t been installed correctly and you might need to repeat the above steps or install some other version of Node.js.

If Node.js is installed successfully on your system, NPM will also become available as it comes integrated with the Node.js installer. To check the version of the NPM, you need to run the following command:

npm -v

Conclusion

We hope that you now are well aware of the steps required to install and verify Node.js and NPM on your Windows. Also, be careful when selecting the source of the Node.js installer and it is advisable to download the installer only from the official Node.js website.

You can also use Chocolatey to install Node.js and NPM, although that process can be quite complex for beginners. Therefore, stick to the instructions above for easy and seamless installation.

People are also reading: 

Leave a Comment