Reputation: 15054
I have a node.js code in WebStorm. I debug the code by using node.js configuration and it works fine.
However, once I run debug mode in npm configuration, WebStorm ignores the breakpoints. I tried to add the variables "--debug" and "--debug-brk" to 'Arguments' field and it still didn't solve the problem.
Upvotes: 1
Views: 594
Reputation: 1041
You need to add $NODE_DEBUG_OPTION (or %NODE_DEBUG_OPTION% on Windows) in your npm script. Please note that NODE_DEBUG_OPTION
should be placed right after node
, where node parameters are expected, for example:
"scripts": {
"start": "node $NODE_DEBUG_OPTION ./bin/www"
}
Upvotes: 0
Reputation: 4977
Please check out this tutorial: http://pavelpolyakov.com/2016/05/01/webstorm-npm-tasks-debug/ You need to add $NODE_DEBUG_OPTION in your npm script. Here's the original issue on the WebStorm tracker.
Upvotes: 1