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. 二分求幂 - A^B(王道*)

    题目描述: 求A^B的最后三位数表示的整数,说明:A^B的含义是“A的B次方” 输入: 输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1<=A,B<=10000),如果 ...

  2. java中short、int、long、float、double取值范围

    一.分析基本数据类型的特点,最大值和最小值.1.基本类型:int 二进制位数:32包装类:java.lang.Integer最小值:Integer.MIN_VALUE= -2147483648 (-2 ...

  3. CentOS7安装Gnome GUI图形界面

    CentOS7安装Gnome GUI图形界面  最小化安装了.当时没 注意,后面一步步安装完了,结果直接启动到命令行模式了. 晕,又不想重新安装,直接想从命令行模式安装.在网上找了半天,终于找到一点小 ...

  4. html5学习整理-0311

    整理一下今天所学的一些标签内容. 首先说一下DNS:全称Domain Name System,域名系统.是因特网上作为域名和IP地址相互映射的一个分布式数据库. URL协议:规定URL地址的格式,UR ...

  5. Ruby中map, collect,each,select,reject,reduce的区别

    # map 针对每个element进行变换并返回整个修改后的数组 def map_method arr1 = ["name2", "class2"] arr1. ...

  6. 倍福TwinCAT(贝福Beckhoff)常见问题(FAQ)-TwinCAT自带的找原点功能块MC_Home怎么用

    对于相对编码器类型轴(包括虚拟轴),可以使用贝福提供的找原点功能块MC_Home.   HomingMode是指机器在往前跑的时候(30单位/s的默认速度),当碰到阻挡,则会有一个布尔值从FALSE改 ...

  7. Rational Performance Tester(RPTv8.6) 在launch Schedule 时一直卡在 29%

    solution:Rational Performance Tester(RPTv8.6) 在launch Schedule 时一直卡在 29% 打开Task Manager(Windows serv ...

  8. lucene 异常 Lock obtain timed out 解决方法

    http://terje.blog.163.com/blog/static/119243712008102122316595/     一般都是索引建立的过程中,不正常操作影响了IndexWriter ...

  9. LwIP协议栈(2):网络接口

    在LwIP中,物理网络硬件接口结构保存在一个全局链表中,它们通过结构体中的 next 指针连接. struct netif { /// pointer to next in linked list * ...

  10. Effective C++ 条款47

    本节条款的题目:请使用trait classes来表示类型信息 本节条款主要讲述的技术是怎样在编译期间实现对迭代器类型的推断,依据推断的类型进行最优处理. 我们先来看一下迭代器的种类: 1.input ...