Debug Electron Main js
Hi, trying to debug an electron application main.js file with webStorm 2017.2.4 I found a strange behavior.
I created the same "run/debug configuration" in two different virtual machine with windows 10 and I set:
- Node interpreter to "<app root>\node_modules\.bin\electron.cmd"
- Working directory to my "<app root>"
- Javascript file to "app\main.js"
In one of the virtual machine it works right and in the other don't work but the configuration is the same.
Difference between the two enviroments is on the "run command" that Webstorm generates when a start the application with the "debug command" and I don't understand why commands are different! I don' know what I'm doing wrong. Commands generated are as follows:
- this works!
C:\Gerry\nodejs\rss-aggregator\node_modules\.bin\electron.cmd --inspect-brk=49492 C:\Gerry\nodejs\rss-aggregator\app\main.js
- this one dont work
"C:\Program Files\JetBrains\WebStorm 2017.2.4\bin\runnerw.exe" C:\Gerry\nodejs\rss-webstorm\node_modules\.bin\electron.cmd --debug-brk=49728 --expose_debug_as=v8debug C:\Gerry\nodejs\rss-webstorm\app\main.js
this is my configuration:

Please sign in to leave a comment.
another difference tha I found:
on the right of "Node interpreter parameter" value content, on version where debug doesn't work, I can see a version number!? in my case is 1.7.6.
In the "working configuration" this version does not appear and I see only this text: "C:\Gerry\nodejs\rss-aggregator\node_modules\.bin\electron.cmd"
to make debug working I found this solution:
on "Node parameters" I have to set the value "--inspect" !
Try updating Webstorm to 2017.3.x where https://youtrack.jetbrains.com/issue/WEB-27784 is fixed; passing `--inspect` manually is a workaround for 2017.2 - see https://youtrack.jetbrains.com/issue/WEB-27784#comment=27-2429456