The procedure falls into two parts: first we start an application as usual and then connect to it with the debugger.

  1. Set the breakpoints in the Node.js code, where necessary. At least one breakpoint is necessary otherwise the program will be just executed. If you want the debugging tool to stop at the first line of your code, set a breakpoint at the first line.
  2. Create a Node.js run configuration with the following option in the Node parameters text box: --debug-brk==<port for connect to debugger remotely>

    Note

    • The --debug-brk option allows you to debug the code executed on start.
    • The --debug option is useful when you are not going to debug Node.js right now, but you want to debug it later.
  3. Run the application with the created configuration.
  4. Create a Node.js Remote Debug configuration: in the Debug port text box, type the port number specified in the currently running Node.js configuration.
  5. With the application still running, launch the Node.js Remote Debug configuration (select the configuration in the list and click the Debug toolbar button ).
  6. In the Run tool window, copy the URL address of the server and open the corresponding page in the browser. Control over the debugging session returns to WebStorm.
  7. Switch to WebStorm. In the Debug tool window, step through the breakpoints, switch between frames, change values on-the-fly, examine a suspended programevaluate expressions, and set watches.

【ask】webstorm调试node单个js文件的更多相关文章

  1. 针对单个 js 文件禁用 ESLint 语法校验

    问题描述: 在 Vue-cli 创建的项目中,使用了 ESLint 规范代码的项目中 如何针对单个 js 文件禁用 ESLint 语法校验,但整个项目依然保留 ESLint 的校验规则? 解决方案: ...

  2. 使用webstorm调试node程序

    前言 相信大家接触过不少node代码了,如果你应用的比较初级或者针对你的项目不需要接触过深的node代码,也许你仅仅需要简单的console.log('your variable')就完全满足你的需要 ...

  3. vue项目引入第三方js插件,单个js文件引入成功,使用该插件方法时报错(问题已解决)

    1.引入第三方js文件,npm安装不了 2.控制台显示引入成功 3.在methods下使用 图片看不清请看下面代码 updateTime() { setInterval(()=>{ var cd ...

  4. 使用webstorm调试node.js

    折腾半天,还是webstorm顺手,但也遇到一些小问题. 1.代码补全问题 nodeJS自身的补全 File->Project Setting->JavaScript->Librar ...

  5. WebStorm调试node.js

    直接上图:

  6. webstorm 设置uglify 压缩js文件

    第一步:打开npm,全局安装 npm install uglify-js -g 第二步: 打开webstorm的file->settings ->External Tools,点击左上角的 ...

  7. webstorm调试Node的时候配置

    点击Edit Configurations的这个的配置:(不能点击是因为目前你选中的不是项目)

  8. 单个 js 文件禁用 ESLint 语法校验

    在代码顶部添加一行注释 /* eslint-disable */ ESLint 在校验的时候就会跳过后面的代码 还可以在注释后加入详细规则,这样就能避开指定的校验规则了 /* eslint-disab ...

  9. 如何调试异步加载的js文件(浏览器调试动态加载js)

    描述 1:jQuery->var obj= new $.js_Obj():等异步加载js文件,执行方法. obj.method(): 2:页面估计不变,通过声明不同的js文件,进行页面内容的转换 ...

随机推荐

  1. 增强学习--Q-leraning

    Q-learning 实例代码 import numpy as np import random from environment import Env from collections import ...

  2. android应用开发-从设计到实现 2-8 组件与经常使用模式

    组件与经常使用模式 前面已经比較全面的介绍了Material Design相关的设计哲学.设计原理和方法论. 这一章開始,我们将看看这些原理是怎样在安卓系统其中得到实践的. 一个应用并非全然从什么都没 ...

  3. KVO(Key Value Observing)

    *KVO能够监听某个对象属性的改变 原理:仅仅要给一个对象注冊一个监听,那么在执行时, 系统就会自己主动给该对象生成一个子类对象,而且重写自己主动生成的子类对象的被监听属性的set方法.然后在set方 ...

  4. wordcount代码实现详解

    阅读目录 1.MapReduce整体流程 2.WordCount源码 3.WordCount逐行解析 Hadoop的框架最核心的设计就是:HDFS和MapReduce.HDFS为海量的数据提供了存储, ...

  5. webpacke install vue application 报错 Failed at the phantomjs-prebuilt@2.1.14 install script

    刚刚在网上下了个开源的项目: https://github.com/ing670/webappkiller 执行npm install 报错:npm ERR! Failed at the phanto ...

  6. @value

    通过name来获取bean对象. 这一点eclipse就没有intelliJ好,拉到方法内部上面就不现实方法名了,这里是上面调用的方法的内部. 处理内部属性: 然后就在这里抛出异常了: 我们打个deb ...

  7. Managed Media Aggregation using Rtsp and Rtp

    his article was written almost 2 years ago, it's content may not reflect the latest state of the cod ...

  8. docker入门——安装及简单操作

    和安装其他软件一样,安装Docker也需要一些基本的前提条件.Docker要求的条件具体如下: 运行64位CPU构架的计算机(目前只能是x86_64和amd64),Docker目前不支持32位CPU. ...

  9. 04-常见内存错误以及valgrind使用

    04-常见内存错误以及valgrind使用 代码段: 仅仅读数据,因此对这一部分的数据.试图写仅仅读数据,这个在编译的时候基本上能够检測. 数据段/BSS段: 未初始化直接訪问,即使没有显示初始化,仍 ...

  10. hdu - 4782 - Beautiful Soup(模拟)

    题意:输出一堆乱排版的html标签,去多余空字符,转换为按缩进输出. 题目链接:pid=4782">http://acm.hdu.edu.cn/showproblem.php?pid= ...