How to Node.js- Installing Node.js on Windows

Node.js is an open-source, cross-platform JavaScript runtime environment to make server-side applications. if you want to make websites, Chat programs, games or even a social network or any web application that actually connect people, then Node.js is a choice for you.

Node.js was developed by Ryan Dahl in 2009. Following are some of the important features that make Node.js

  • Asynchronous and Event Driven − All APIs of Node.js library are asynchronous, that is, non-blocking. It essentially means a Node.js based server never waits for an API to return data.
  • Very Fast − Being built on Google Chrome’s V8 JavaScript Engine, Node.js library is very fast in execution of code.
  • Single Threaded but Highly Scalable − Node.js uses a single threaded model with event looping. Event mechanism helps the server to respond in a non-blocking way and makes the server highly scalable as opposed to traditional servers which create limited threads to handle requests.
  • No Buffering − Node.js applications never buffer any data. These applications simply output the data in chunks.
  • Open source: Node.js has an open source community which has produced many excellent modules to add additional capabilities to Node.js applications.

Installing Node.js on Windows

In this tutorial, we are going to learn how to install Node.js on Windows computer. Download the Node.js pre-built installer from https://nodejs.org. For windows download the MSI installer file to your computer.

 

Nodejs installation

 

Once you finish the download, install the downloaded setup file.  You just keep default settings while installing Node.js, accept the license agreement, use default location while you select the installation directory and select the default way you want to install features of Node.js.

Install the Node.js by clicking on Install button and wait to complete the installation process. Once you complete installation, click finish button.

 

Nodejs installation

 

The node.js installation will set a system path variable on your computer. To confirm the installation of Node.js and system path, open up your command prompt and run node command. and type console.log() .

Command Prompt
  Microsoft Windows
  [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.
  C:\Users\yp>node > console.log('Lauyou Learning') Lauyou Learning

console.log() method used to display the message on the console. i.e Node.js successfully installed if you get the message on the console. let’s go ahead and install an IDE for Node.js development.

 

Configuring Node.js IDE

There are many IDEs available for Node.js development. This tutorial we are going to use Webstorm IDE for Node.js development. WebStorm is a popular JavaScript IDE, which is ideal for server-side development with Node.js. The IDE provides intelligent code completion, navigation, automated and safe refactorings and other features.

You can download Webstorm from www.jetbrains.com/webstorm. Download the IDE installer and install it to your computer with default settings.

 

Nodejs installation

 

Make sure the NodeJS plugin is enabled. The plugin is bundled with WebStorm and activated by default. If the plugin is not activated, enable it on the Plugins page of the Settings / Preferences Dialog.

Click Create New Project on WebStorm Welcome screen and select Node.js Express app template. On dialog window you can select configuration options, like node interpreter, to specify the template language you are going to use. WebStorm automatically locates Node.js and NPM on your computer.

For this example, we are creating a project named “first-project” and keep everything default. Click on the create button to create the project.

 

Nodejs installation

 

Now WebStorm is set up to work with Node.js projects.  It’s good to start developing using Node.js scripting.

WebStorm is a cross-platform IDE primarily for web, JavaScript and TypeScript development.

 

Nodejs installation

Anwar Yakkiparamban

Anwar Yakkiparamban is the founder of Lauyou Learning. Prior to Lauyou learning, Anwar worked at ARD Engineering & Development, Qatar. He holds bachelor degree in Electronics and Communication Engineering from Govt. Engineering College Idukki.

You may also like...