Installing Node.js on Windows 11: A step-by-step guide

Posted by


Node.js is a popular JavaScript runtime that allows you to build fast and scalable web applications. In this tutorial, I will walk you through the steps to install Node.js on Windows 11.

Step 1: Download Node.js
The first step is to download the Node.js installer from the official Node.js website. Open your web browser and go to https://nodejs.org/. On the homepage, you will see a button that says "Download". Click on this button to start the download process.

Step 2: Run the Node.js Installer
Once the download is complete, locate the Node.js installer file in your downloads folder and double-click on it to run the installer. You may see a Windows Security warning asking if you want to allow the installer to make changes to your device. Click "Yes" to continue.

Step 3: Choose Installation Options
In the Node.js installer, you will be presented with some installation options. Generally, you can stick with the default settings, but there are a couple of options worth noting. One is the Custom Setup option, where you can choose which components to install. The other is the option to add Node.js to your system PATH, which is recommended as it makes it easier to run Node.js commands from the command line.

Step 4: Install Node.js
Click "Next" to proceed with the installation. The installer will start extracting files and installing Node.js on your system. This process may take a few minutes, so be patient. Once the installation is complete, you will see a "Completed" message.

Step 5: Verify the Installation
To verify that Node.js has been successfully installed, open a command prompt by typing "cmd" in the Windows search bar and pressing Enter. In the command prompt, type the following command and press Enter:

node -v

This command will display the version of Node.js that is installed on your system. You should see a version number, such as "v16.14.1".

Step 6: Install npm (Node Package Manager)
Node.js comes with npm (Node Package Manager) built-in, but it’s a good idea to update it to the latest version. To do this, run the following command in the command prompt:

npm install npm@latest -g

This command will install the latest version of npm globally on your system.

Step 7: Test Node.js
To test that Node.js is working correctly, create a simple JavaScript file. Open Notepad or any text editor and add the following code:

console.log("Hello, Node.js!");

Save the file with a .js extension, such as hello.js. Open a command prompt and navigate to the directory where you saved the file. Run the following command:

node hello.js

You should see the message "Hello, Node.js!" printed to the console.

Congratulations! You have successfully installed Node.js on Windows 11. You are now ready to start building amazing web applications using Node.js.