How to Install Node.js on Windows 10 [4 Steps]

In this article , We are going to perform Download Node.js for Windows, How to Install Node.js on Windows 10, update the node.js and npm on windows, creating node.js app on windows, uninstalling node.js from windows 10.

What is Node.js ?

Node.js is free and an open-source cross-platform JavaScript run-time environment that allows server-side execution of JavaScript code. It is used in developing web and networking applications

What is NPM (Node Package Manager) ?

NPM (Node Package Manager) is command line tool for Node.js packages that installs, updates and uninstall packages in your projects.We don’t have install npm separately it is includes with Node.js installation.

Prerequisite

  • Windows 10 with Administrator Access

Step #1: Download Node.js package for Windows

First download the latest node.js package from node.js official site and click on Windows installer, it will download .msi file.

Click on 32 bit or 64 bit version of node.js for windows.

How to Install Node.js on Windows 10 [4 Steps] 1

once you clicked, it will ask for to save dowloaded node.js msi setup, click on Save File.

How to Install Node.js on Windows 10 [4 Steps] 2

once downloaded, double click on node.js Windows Installed .msi file.

you will see Node.js Setup Wizard , click on Next as shown below.

How to Install Node.js on Windows 10 [4 Steps] 3

click on Node.js License agreement and click on Next.

How to Install Node.js on Windows 10 [4 Steps] 4

Select Destination folder where you want to Install Node.js and click on Next.

How to Install Node.js on Windows 10 [4 Steps] 5

Select on to install npm modules like python and Visual Studio Build Tools if not installed and click on Next

How to Install Node.js on Windows 10 [4 Steps] 6

custom setup for Node.js and click on Next.

How to Install Node.js on Windows 10 [4 Steps] 7

Step #2: Install Node.js on Windows

Now Install Node.js on Windows 10, click on Install.

How to Install Node.js on Windows 10 [4 Steps] 8

wait to finish to Install Node.js on Windows.

How to Install Node.js on Windows 10 [4 Steps] 9

once installing of Node.js finished, click on Finish.

How to Install Node.js on Windows 10 [4 Steps] 10

It will open commands prompt to Install Addition Tools for Node.js for Windows, click Enter.

How to Install Node.js on Windows 10 [4 Steps] 11

once you entered, it will open Windows Powers shell and wait till to Install additional Tools for Node.js.

once all finished, open a commands prompt .

Check Node.js and npm version on Windows.

How to Install Node.js on Windows 10 [4 Steps] 12

Note: when you install node.js using msi installed, you don’t need to setup system variables for node.js.

Step #3: How to Update Node.js and NPM on Windows

To update node.js and npm on windows , you can download the node.js version from the node.js official site , install and replace it with existing version.

OR

open a commands prompt and run below commands to update the node.js and npm on windows

npm install npm –global

Output:

C:\Users\fosstechnix\AppData\Roaming\npm\npm -> C:\Users\fosstechnix\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
C:\Users\fosstechnix\AppData\Roaming\npm\npx -> C:\Users\fosstechnix\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
+ [email protected]
added 434 packages from 885 contributors in 8.878s

Step #4: Create a Node.js Application on Windows

Create a javascript file with name nodeapp.js in C:\Users\your name\ location, add below code which prints ” Hello World”.

sudo nano nodeapp.js

Paste the below lines into it.

const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
});

  server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

Run your Node.js server with the below command,

node nodeapp.js

Output:

 node nodeapp.js

Server running at http://127.0.0.1:3000/

Now open your browser and type server name or IP followed by port 3000, you will see Hello World message.

http://localhost:3000/

you will see “Hello World” Message on your browser.

How to Uninstall/Remove Node.js and NPM from Windows

To Uninstall or completely Remove Node.js and NPM from Windows 10.

1. Open the Control Panel

2. click on Programs and Features

3. Select Node.js

4. click on Uninstall Button

It will ask to confirm uninstall node.js from Windows.

Conclusion:

In this article, We have performed, Download Node.js for Windows, How to Install Node.js on Windows 10, update the node.js and npm on windows, creating node.js app on windows, running and testing node.js app, uninstalling node.js from windows 10.

Related Articles

How to Install Node.js and NPM on Ubuntu 20.04 LTS

How to Install Latest Node.js and NPM on Ubuntu 19.04,18.04/16.04 LTS

How to Install Angular CLI on Ubuntu 18.04/16.04 LTS

How to Install node.js on Mac OS

FOSS TechNix

FOSS TechNix (Free,Open Source Software's and Technology Nix*) founded in 2019 is a community platform where you can find How-to Guides, articles for DevOps Tools,Linux and Databases.

2 thoughts on “How to Install Node.js on Windows 10 [4 Steps]”

  1. Hi,
    Great article.
    I have recently installed Node as a beginner and i ran into some trouble and was wondering if anyone could tell me why this was happening.
    I downloaded LTS version 14.16.0 and used sha256sum to verify file. installation went great till the part command promt pops up, i pressed enter but my McAfee antivirus immediate killed the command promt and gave me a popup with this msg: “We stopped something dangerous
    We caught something trying to hijack one of your apps. Don’t worry, we took care of it.”
    I looked at my app list in start menu and Node.js file is there and seems to be installed. i see a command promp file “Install Additional Tools for Node.js”. when i click this opens the command promt as it did during installation. i press enter again and this time McAfee immediatly quarantines windows powershell.exe. i’v since removed powershell out of quarantine and tried to repeat process but encounter the first popup msg. Comming to conclusion i will most likely say goodbye to McAfee total security.
    But before i do, im hoping someone can clarify what are some possible reason this is happening.
    Thanks

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap