This issue has plagued me more than I care to admit. Since Electron is developing at a furious rate, you may have a new Electron version to compile to every few days it feels. Each time they update something in the core, you’ll have to recompile any native modules that your project might be using.
When in doubt, run electron-rebuild they say. Use node-pre-gyp. Set a few environmental variables. None of these had anything close to a good success rate.
Start from scratch
Maybe its my NPM scripts, maybe its since I’ve done much of the work on a Windows machine. Whatever the case, the most successful technique is to set your npm environmental variables like so. Type this in your favorite CLI at the project root.
# Electron's version.
# The architecture of Electron, can be ia32 or x64.