How to Node.js- Installing Node.js on Windows
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.
- 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.
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.
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
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
You can download Webstorm from www.jetbrains.com/webstorm. Download the IDE installer and install it to your computer with default settings.
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.
Now WebStorm is set up to work with Node.js projects. It’s good to start developing using Node.js scripting.