Skip to content

How to Install Node.js on Windows?

Last updated on November 21, 2022

In this post, I am gonna write About node.js installation on Windows operating systems.

Go to nodejs.org node official website, and click on the install button, will automatically download pre complied Binary for your computer and the installer will configure it automatically. There are a couple of disadvantages of pre complied Binary installation, updates required re-installation, and switching b/w different versions requires a new installation.

Quick Steps :

1. Go to the NodeJS home page
2. Click install to download the Binary installer package
3. Run it and follow the instructions, you now have NPM (node package manager) and Node.js installed
4. Reset your computer to get everything working in your command-line interface (CLI)

Node.js Installation using a version manager

Another way of installing node is using version manager (nvm – Node Version Manage), we can easily install and switch b/w version using this method, visit the GitHub page for installation Steps at:https://github.com/creationix/nvm

Verify Installation of Node.js on Windows

Here’s a quick program to make sure everything is up and running correctly,

var http = require('http');

http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  response.end('Hello Worldn');
}).listen(8124);

console.log('Server running at http://127.0.0.1:1337/');

To run the server, put the code into a file called example.js and execute it with the node program

> node example.js
Server running at http://127.0.0.1:1337/

Now point your Browser at: http://127.0.0.1:1337/,
This should display an image similar to the Below Image. If it still isn’t working walk back through the above steps or leave a comment below for more help.
node-js-hello-world

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments