从gulp运行时,在WebStorm中调试节点应用程序 [英] Debugging node app in WebStorm when run from gulp
问题描述
我正在使用 webstorm 10.0.2
并使用了 bangular
yeoman code>模板来生成一个项目。我可以通过gulp窗口运行gulp命令,并且我可以在
gulpfile.js
中设置一个断点,它会触发它,但我似乎无法得到它在我的 server.js中打断点
它在我看来像吞食文件正在启动另一个实例 node
,因此当你从webstorm进行调试时,你只是在调试吞咽。
我也尝试过使用 yo hottowel
的另一个项目,但得到同样的结果 - 我无法调试实际应用程序通过webstorm。
任何人都可以告诉我如何配置webstorm,以便我可以调试实际的服务器端节点代码,但仍然使用gulp构建工具?
我于2015年5月联系了JetBrains支持人员,他们的回复是:
看来这不可能很快完成。简而言之,问题在于serve-dev任务启动了需要app.js
的新进程(nodemon),目前没有解决方法来调试此类衍生进程。如果您在我们的YouTrack中提交有关此功能的请求,我们将非常感激: https://youtrack.jetbrains .com / issues / WEB
您可以尝试避免它的唯一方法 - 尝试创建一个独立的任务,它将直接运行app.js,而无需nodemon进程并调试此任务。
I am using webstorm 10.0.2
and have used the bangular
yeoman
template to generate a project. I can run the gulp commands via the gulp window, and I can set a breakpoint in the gulpfile.js
and it will hit it, but I can't seem to get it to hit a breakpoint in my server.js
It looks to me like the gulp file is launching another instance of node
and thus when you do "debug" from webstorm you are just debugging the gulp.
I also tried with another project using yo hottowel
but get the same thing - I am unable to debug the actual application through webstorm.
Can anybody tell me how to configure webstorm so that I can debug the actual server side node code but still use the gulp build tool?
I contacted JetBrains support back in May 2015 and their response was:
It seems this cannot be done quickly. In short, the problem is that serve-dev task starts new process (nodemon) that takes app.js There is no workaround how to debug such spawned processes right now. We would really appreciate if you'll submit a feature request about it in our YouTrack: https://youtrack.jetbrains.com/issues/WEB The only way you can try to avoid it - try to create a separate task that will run app.js directly without nodemon process and debug this task instead.
这篇关于从gulp运行时,在WebStorm中调试节点应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!