Introduction
This article is intended to help you create your first node.js application with the Visual Studio 2017. Node.js is a JavaScript based platform, built on Google’s Chrome V8 engine. It’s not a JavaScript library, rather, it’s a server side runtime environment which runs JavaScript code.
It has following features.
- It is open source and cross platform application.
- All APIs of Node.js are asynchronous. It means the request executes parallel rather than in a queue.
- Its input/output operations are non-blocking. So, its performance is also better.
- It’s event driven. In other words, all the tasks are performed in accordance with the event.
- It creates HTTP server similar to SignalR Server rather than same as IIS.
As browser runs JavaScript code on client side, similarly Node.js runtime runs JavaScript on Server side.
Node.js Installation
There are some steps which comply during installation of Node.js on the windows machine. These are as follows:
- Download Node.js Set up installer from official site https://nodejs.org/en/. There are two window installer options, one is V6.10.0 LTS while another is V7.7.3 Current. So, go with first option. It downloads a windows installer named node-v6.10.0-x64.msi. The LTS is Long Term Support version which uses for production while Current version has new features which uses for development.

Figure 1: Download Node.js Set up
- Now, run node-v6.10.0-x64.msi Windows Installer. It opens Installation Wizard. So, follow these steps until you're finished.

Figure 2: Node.js Set up wizard
- Once the installation completes, restart the system.
Test Node.js Environment
As per the above procedure, Node.js has been installed in the system. Now, by running a simple command, make sure that Node and NPM are installed properly.
- First, to see if Node is installed or not, run the Powershell and type command node –v and press Enter. It prints Node.js version something like v6.10.0
- Now, to see if NPM is installed, type npm –v in the same PowerShell window. If it prints a version number such as 3.10.10 that means NPM has been installed.
- Run some JS samples to test if Node.js works on system. First, start Node.js using command “node”. It opens shell where JavaScript code executes by row or block. After that, type JavaScript code such as console.log(“Hello Node Js”); in the Shell window and run it.
Node executes this code and prints output “Hello Node Js” followed by “undefined”. Node.JS always returns a value of each command and console.log function doesn’t return anything.Now, types command .exit in the terminal so that we can exit from Node.
- Another way to test if node.js works is to create a JavaScript file: name it hello.js, and just add the code console.log ('Node.js is ready to use');.
To run the code, type node hello.js. This will start Node and run the code in the hello.js file. We should see the output as -
'Node.js is ready to use'.

Figure 3: Test Node.js Environment
Node.js with Visual Studio 2017
To develop the Node.js application using the Visual Studio 2017 IDE, we install Node.js development workloads. This installation creates in-built templates for Node.js application.



Hemant MahajanPosted Jul 5, 2017, 1:51 PM
Good and useful info. It saved a day effort of mine!. Thanks!
Sandeep Singh ShekhawatPosted Mar 20, 2017, 1:43 PM
Thanks Vignesh Mani and Manav Pandya for read and comment :)
Vignesh ManiPosted Mar 20, 2017, 1:31 PM
Nice one. THanks you for sharing.
Manav PandyaPosted Mar 20, 2017, 3:45 AM
Thanks for sharing such information ..