[Nodejs] Debug nodejs using the Web storm Tool

Source: Internet
Author: User

In the terminal, run the command, locate the folder, and then node XXX. js? You are out. Now we have a better way to debug nodejs. Why not use it? We only need a shortcut key. WS itself has good support for nodejs, and it will become easy to use WS to develop and debug nodejs.

 

1. Install nodejs. nodejs already provides compiled files on various platforms. You do not need to compile the files. download and install the corresponding version of your own platform.

Http://nodejs.org/

 

2. Install the Javascript artifact webstorm. webstorm is also a good software that supports multiple platforms. Note that WS is a commercial paid software and can be used for 30 days.

Http://www.jetbrains.com/webstorm/

 

3. Open ws for nodejs configuration. A very eye-catching nodejs icon has been added to WS since 3.0. The OSX version is used as an example below. There is no difference between win version and win version.

 

Click the node. js icon. The following dialog box is displayed to configure the node. js path.

In Windows, you only need to install the directory BINLOG to locate node.exe. If you have any problems with MacOS, enter the command on the terminal and enter the relevant path.

 
$ Open/usr/

If it is too troublesome, copy the path I provided.

 
/Usr/local/bin/node

You do not need to modify other parameters.

 

4. Configure your nodejs development folder and click the configuration button to configure the following dialog box.

After completing the configurations.

Debugging

1. When debugging, you only need to click the run button, the software will automatically start the console.

 

2. Access the address in the browser

 

 

3. Use the console command

 

 
Console. Log (This);

 

Output Context

 

Is it great? It's very powerful.

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.