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. 在eclipse上配置tomcat

    Eclipse中Tomcat的配置及简单例子 Eclipse中Tomcat的配置是很简单的一个工作,作为一名刚刚起步的编程菜鸟,我将这个配置的过程和简单的例子写下来记录,也希望能给像我怎样的新手一些帮 ...

  2. [Angular] Angular Custom Change Detection with ChangeDetectorRef

    Each component has its own ChangeDetectorRef, and we can inject ChangeDetectorRef into constructor: ...

  3. S7:享元模式 Flyweight

    运用共享技术有效的支持大量细粒度的对象. 应用场景: A.减少对相同对象的重复创建 UML: 示例代码:如果在工厂中,有用户,我们就直接调用,没有用户,我们就获取.减少对同一uid的user对象的重复 ...

  4. 时间见证着—eternal life

    上帝并不是这么公平的爱每个人,祂会多爱那些在困难.痛苦.悔恨中的人一点点.因为在那个当下,他们比一般人更需要知道上帝对他们的爱.   开通空间:http://imgcache.qq.com/qzone ...

  5. mysqli 预处理语句

    预处理语句用于执行多个相同的 SQL 语句,并且执行效率更高. <?php // 设置编码格式 header('content-type:text/html;charset=utf-8'); / ...

  6. 一个好用的短连接服务,mark备用

    http://to.ly/api.php? longurl=http://www.example.com 当中http://www.example.com 是你所须要转换的长链接地址.经过一个简单的g ...

  7. select/poll/epoll原理探究及总结

    select,poll,epoll都是IO多路复用的机制.I/O多路复用就通过一种机制,可以监视多个描述符,一旦某个描述符就绪(一般是读就绪或者写就绪),能够通知程序进行相应的读写操作.但select ...

  8. JavaScript 事件循环及异步原理(完全指北)

    引言 最近面试被问到,JS 既然是单线程的,为什么可以执行异步操作? 当时脑子蒙了,思维一直被困在 单线程 这个问题上,一直在思考单线程为什么可以额外运行任务,其实在我很早以前写的博客里面有写相关的内 ...

  9. bzoj1670【Usaco2006 Oct】Building the Moat 护城河的挖掘

    1670: [Usaco2006 Oct]Building the Moat护城河的挖掘 Time Limit: 3 Sec  Memory Limit: 64 MB Submit: 387  Sol ...

  10. nginx利用lua实现nginx反向代理proxy_store缓存文件自删除

    标题有点绕口.我尽量把关键词都贴进去.之前因为自己的nginx安装了ngx_lua模块,但是又需要引入 但是安装luafilesystem又需要先安装luarocks,比较繁琐.这里就想记录一下安装过 ...