How to debug electron applications with IntelliJ o

2019-02-12 03:23发布

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).

2条回答
做个烂人
2楼-- · 2019-02-12 03:49

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

查看更多
叼着烟拽天下
3楼-- · 2019-02-12 04:06

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

查看更多
登录 后发表回答