Configuration of the 1:nodejs development environment

Source: Internet
Author: User

Configuration of the Nodejs development environment:

Just started to learn mainly on Mac, so temporarily only recorded on their own Mac learning experience;

One: Installation

1: Download node's operating environment from official website

https://nodejs.org/

2: Double-click the pkg file installation, the general node itself will be in the environment variables to add their own;

After installation, you can see

Two: Test,

1: Open terminal input node-v,

You can see the following version information, indicating that the installation is OK.

2: Install a debug tool: Supervisor

sudo npm install-g Supervisor

Three: a small demo

1: New nodedemo.js, Content:

Console.log ("Hellow Node js!");

2: In the terminal CD to the directory where the Nodedemo.js is located, and execute:

Node Nodedemo.js

Immediately after the terminal output: Hellow Node js!

3: It means everything is installed successfully!

Four: can also use: Supervisor start JS Application;

For example: in the terminal

Supervisor Nodedemo.js

The advantage of using supervisor is that the modified code can be refreshed dynamically without stopping the service;

Test examples in the next section

Configuration of the 1:nodejs development environment

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.