热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

从gulp运行时在WebStorm中调试节点应用程序-DebuggingnodeappinWebStormwhenrunfromgulp

Iamusingwebstorm10.0.2andhaveusedthebangularyeomantemplatetogenerateaproject.Icanr

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

我正在使用webstorm 10.0.2并使用bangular yeoman模板生成一个项目。我可以通过gulp窗口运行gulp命令,我可以在gulpfile.js中设置一个断点,它会点击它,但我似乎无法让它在我的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.

在我看来,gulp文件正在启动节点的另一个实例,因此当您从webstorm进行“调试”时,您只是在调试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.

我也尝试使用yo hottowel的另一个项目,但得到相同的东西 - 我无法通过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?

任何人都可以告诉我如何配置webstorm,以便我可以调试实际的服务器端节点代码,但仍然使用gulp构建工具?

2 个解决方案

#1


1  

I contacted JetBrains support back in May 2015 and their response was:

我在2015年5月联系了JetBrains支持,他们的回复是:

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.

看来这不可能很快完成。简而言之,问题是serve-dev任务启动了采用app.js的新进程(nodemon)现在没有解决方法如何调试这样的生成进程。如果您在我们的YouTrack中提交有关它的功能请求,我们将非常感激:https://youtrack.jetbrains.com/issues/WEB您可以尝试避免它的唯一方法 - 尝试创建一个单独的任务,将运行app.js直接没有nodemon进程并调试此任务。

#2


0  

It seems the best option is to use https://www.npmjs.com/package/gulp-node-inspector

似乎最好的选择是使用https://www.npmjs.com/package/gulp-node-inspector


推荐阅读
author-avatar
zhanwang
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有