I've encountered two debugging configurations for node.js in WebStorm: Node.JS debug and node.js Remote Debug. You can see both of them here:
My question is what is the difference between these two? and when should we use each one of them?
With Remote Debug configuration, you can attach the debugger to already running Node application started with --debug-brk
. See https://www.jetbrains.com/help/webstorm/2016.3/running-and-debugging-node-js.html#remote_debugging, https://confluence.jetbrains.com/display/WI/Running+and+debugging+Node.js+application#RunninganddebuggingNode.jsapplication-DebuggingNode.jsappthatrunsremotely
With Node.js run configuration, you can start the Node.js interpreter (either local or remote) and pass your application to it.