Installing the node. JS module with NPM and debugging

Source: Internet
Author: User

Npm

NPM, as a package manager for node. JS, is a frequently used tool.

Note: To install a framework globally, you need to add the parameter-G

NPM Install-g Express

After installation

You only need to import the package in the project

var http = require (' http ');

Debugging

The simplest way to debug node is Console.log (), but sometimes it takes one step to debug

  1. Write debugger where debugging is required

  2. Node Debug *.js

The test command in node:

Next,n: Single Step execution

Cont,c: Continue execution until the next breakpoint is encountered

Step,s: Stepping and entering functions

Out,o: Jumping out of a function

Watch: Add expression expressions to the watch list






Installing the node. JS module with NPM and debugging

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.