Debugging node js in Webstorm while working from gulp

I'm new to this, but I really tried my best to look for answers.

I used yoman to create the application. ('angular fullstack' is used - https://github.com/angular-fullstack/generator-angular-fullstack )

It has a gulpfile.babel.js configuration file that runs nodemon.

What I'm trying to do is make the instance of the gulp instance an instance of nodemon to hit the Webstorm breakpoints that I have.

What I have tried so far:

- Regular debugging. (trivial.) But it seems like node is throwing exceptions when it encounters ECMA6 syntax. (However. I would rather run a gulp instance than run it from webstorm.)

- Using --debug

- Using "remote debugging" in webstorm.

- configure node inspector in gulp task and configure it to listen 5353

- Using --debug-brk and debugging on port 5353 (for example)

I really could appreciate it if someone could help me. This guy says that Webstorm cannot handle this case, but it is strange, you can debug remote servers, but you cannot debug a gulp instance of a nodemon server? Debugging node applications in WebStorm on startup from gulp

+6
source share
1 answer

Assuming you are using Node.js. It provides a node inspector for debugging files on the server side on the Chrome browser itself, with the same experience given in browser debugging.

Below is a link to configure the node inspector.

Below are the steps to install the node inspector.

1) Install node inspector with command

npm install -g node-inspector 

2) Run the node inspector. You can run it from any directory.

 node-inspector 

As a result, you get the url for debugging in the browser

3) Restart the node server in debug mode

change the directory to your project server folder

 cd /path/to/your/project/directory/nodejs/server node --debug server 

4), as soon as the server is started in debug mode successfully, copy the URL obtained as a result of the above and open it in the Chrome browser . There you can see all the files on the server side of Node.js in the source section of the debugger , where you can apply breakpoints on the server javscript files that were written.

+2
source

All Articles