Debugging node applications in WebStorm on startup from gulp

I use webstorm 10.0.2 and used the bangular yeoman to create the project. I can run gulp commands through the gulp window, and I can set a breakpoint in gulpfile.js and it will hit it, but I cannot get it to hit the breakpoint in my server.js

It seems to me that the gulp file starts another instance of node , and thus, when you debug the web server, you are just debugging the gulp.

I also tried using another project using yo hottowel , but I get the same thing - I cannot debug the actual application through webstorm.

Can someone tell me how to configure webstorm so that I can debug the server side code of the node, but still use the gulp build tool?

+6
source share
2 answers

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

This seems impossible to do quickly. In short, the problem is that the serve-dev task starts a new process (nodemon) that accepts app.js. There is no workaround for debugging such spawned processes right now. We will be very grateful if you send a request for this to our YouTrack: https://youtrack.jetbrains.com/issues/WEB The only way to avoid this is to try to create a separate task that will launch app.js directly without the nodemon process and debug this task instead.

+1
source

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

0
source

Source: https://habr.com/ru/post/986445/


All Articles