IntelliJ IDEA how to correctly pass $NODE_DEBUG_OPTION to npm-run-all

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 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. But this option has to be passed to Node.js - not to npm-cli.js, npm-run-all, etc. If npm-run-all is an npm script that starts the app you'd like to debug with node.js, you need to modify this script accordingly, like:

"npm-run-all": "node $NODE_DEBUG_OPTION myapp.js" 

If your task runs a shell script, that, in turn, runs your app with node.js, you need to modify a shell script... The goal is to start the node process with debug options