Search code examples
javascriptnode.jswebstormelectron

How to integrate Electron to WebStorm having no "Module is not installed" hint?


My Electron project works just fine. But I can't go to the declaration of the electron plugin and I can't figure out how to solve that.

Basically I just wanna get rid of that hint shown in the image below and instead being able to go to it's declaration.

Module is not installed...

Unresolved function or method...

Thanks.


Solution

  • You'll need to install TypeScript type definitions for Electron, the first section of this blog post explains how to setup code completion for ReactJS in WebStorm:

    To enhance code completion with typed parameter information we recommend that you add a TypeScript definition file for react.d.ts as a JavaScript library for the project.

    Go to Preferences | Languages & Frameworks | JavaScript | Libraries, click Download…, select TypeScript community stubs, search for react and click Download. The file will be added as JavaScript library for WebStorm to use in coding assistance.

    You should be able to install the Electron type definitions the same way, keep in mind that the typings for Electron are named github-electron (as opposed to just electron).