How to Install Node.js on Windows? A Beginner’s Guide

Posted on

Node.js is an open-source JavaScript runtime environment that facilitates the creation of scalable applications. These applications can be hosted using Node.js hosting. Node.js is compatible with Unix, Linux, macOS, and Windows operating systems. Windows, being a popular choice among web developers, makes Node.js installation on this platform a common need. This guide provides a clear path for both beginners and experienced developers to successfully install Node.js on Windows.

This article will walk you through the process of installing Node.js on Windows, offering valuable insights for those new to the environment.

Setting up the Node Development Environment

Node.js can be installed on a computer using various methods, depending on the system’s existing Node environment and package installers. Options include copying source code and running it via command prompt, compiling the application, or cloning a GIT repository and then installing it. This process can differ across various environments.

Downloading and Installing Node.js on Windows

To begin installing Node.js on your Windows system, the first step is to download the official Node.js installer from their website.

Downloading the Node.js ‘.msi’ installer.

Visit the official Node.js website (https://nodejs.org/en/download/) and download the appropriate .msi file (either 32-bit or 64-bit) for your system. This installer is crucial for the installation process on Windows.

download nodejs msi installer

Running the Node.js installer

After downloading the .msi installer, follow these steps to install Node.js on your computer:

Double-click the .msi installer.

The Node.js Setup wizard will launch.

  • In the Node.js Setup Wizard, click “Next”.
  • You will be prompted to accept the End-User License Agreement (EULA) after clicking “Next”.
  • Check the “I accept the terms in the License Agreement” box and then click “Next”.
  • Choose the destination folder for Node.js files and click “Next”.
  • Configure the setup as needed and click “Next”.

You are now ready to install Node.js on your computer.

  • The installer will prompt you to “install tools for native modules”. Select “Install”.

Do not close the installer window while the installation is in progress.

  • Click “Finish” once the Node.js setup is complete.

Verification

To confirm that Node.js has successfully installed, run the following command in either the command prompt or Windows PowerShell:

C:\Users\Admin> node –v

If the installation is successful, the command prompt will output the installed Node.js version.

If the path isn’t automatically configured, you may need to manually add the node path. An error message will appear if the node command is not recognized.

Adding to the path:

When using the .msi installer, the Windows installer typically manages setting the system variables. However, if you installed Node.js using a different method, you may need to manually set the system variable path.

The necessary system variable path for Node.js should be configured as follows:

PATH : C:\Users\{username}\AppData\Roaming\npm C:\Program Files\{path to the nodejs folder}

For example:

PATH : C:\Users\admin\AppData\Roaming\npm C:\Program Files\nodejs

Note: The PATH variable is only loaded when a new command-line session is started. Therefore, you must restart the command line after changing it.

Updating the Local npm version.

After successfully installing Node.js, it is advisable to update the local npm version (if required), which is Node.js’s package manager. To quickly update npm, utilize the following command:

npm install npm –global // Updates the ‘CLI’ client 

System Requirements for Node.js Installation on Windows

Before starting the setup process, verify that your system adheres to these minimal prerequisites to ensure smooth installation and efficient performance.

  • Operating System: Windows 7 or later
  • Processor: 1 GHz or faster
  • RAM: 512 MB or more
  • Disk Space: 200 MB or more
Conclusion

This guide provides a straightforward approach for Windows OS users to successfully install Node.js on their machines. By following these instructions and ensuring the system requirements are met, developers can easily set up Node.js for their projects.