Home » Nodejs » How to debug electron applications with IntelliJ or WebStorm?

How to debug electron applications with IntelliJ or WebStorm?

Posted by: admin November 30, 2017 Leave a comment

Questions:

I’m using IntelliJ as development tool and I wanted to know how to debug an Electron application?

I’m aware there is a standard way to debug Electron applications, but this method is done outside of my IDE.

I’ve tried to create a new “Node.js” “Run/Debug Configuration” using:

  • Node interpreter: <path to node>
  • Working directory: <path to my application root folder>
  • JavaScript file: node_modules/.bin/electron
  • Application parameters: .

With this settings, my application starts, but if I put a breakpoint in my main.js the application never stops on the breakpoint (= debugging doesn’t work).

Answers:

This is how I set it up, and it worked great. I then just put my break points inside of webstorm and it just works.

In webstorm create a new runtime configuration that looks like this.

Here is a screenshot of my webstorm run configuration

Questions:
Answers:

Try to change your node interpreter by the electron executable in your node_modules. It seems to work fine for me 😉