Node. js (installation, start, and test) _ node. js-js tutorial

Source: Internet
Author: User
This section describes the simplest and most convenient installation methods, startup, and simple testing concepts based on windows.

Node. js is a platform built on Chrome javascript runtime. It is easy to build fast, scalable network applications. Node. js uses the event-driven, non-blocking I/O mode, which enables it to be lighter, efficient, and perfect for data-intensive real-time applications running between distributed devices.

Install

Here we will introduce the simplest and most convenient installation method based on the windows platform. First, visit the official node. js website http://www.nodejs.org/and click install to start and download the installation.

Click the Run button to start running.

Click Next

Select Accept and click Next.

Select the installation directory and click Next.

Select the function to be installed. Here we keep the default installation status and click Next.

Click Install.

Click Finish to Finish the installation.

Start Node. js

Two methods:

1. Click the application icon from the Start menu to start

2. Enter node through the command line to directly enter the node environment, and enter console. log ("hello world! ") Test console Node console output

Test Node

Create a testnode. js file on the machine running Node. js and enter the following test code:

Then store testnode. js to a disk directory, open node. js command line, switch to node. in the js test code directory, enter node testnode in the command line. js command. In the firewall warning window (caused by firewall settings), click the Allow Access button to Allow the operation.

NOTE: For the first time, I entered testnode. js in a confused manner. The result showed a running exception, which was very embarrassing, mainly because I was not familiar with node. js, as shown in the exception. You only need to enter the node command correctly to avoid this exception.

Then open the browser and enter the browser address: http: // 127.0.0.1: 3000 or http: // localhost: 3000 to run the testnode. js file.

The running effect is as follows:

Well, it seems that everything is running normally. Today, the initial research on Node. js is here. I will further record my learning process in future articles. Thank you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.