Kevin
Kevin

Reputation: 2889

Debugging npm scripts without modifying package.json

Is there any way to put $NODE_DEBUG_OPTION in the WebStorm run/debug config rather than rewrite the package.json script command to explicitly run node?

Upvotes: 0

Views: 290

Answers (1)

lena
lena

Reputation: 93738

No; adding $NODE_DEBUG_OPTION to package.json manually is the only way to debug the application started via npm script, because you have to make sure that Node.js process you'd like to debug is started with appropriate debug options (--debug-brk, --inspect-brk, etc), and the IDE can't control the way child processes are spawned - it can only pass options to the main process when starting it.

See also http://pavelpolyakov.com/2016/05/01/webstorm-npm-tasks-debug/ - you may find this article helpful

Upvotes: 1

Related Questions