Build and Target platform: Windows 7 64bit
Running the generated Exe results in an error dialog being presented reporting
"A JavaScript error occurred in the main process".
"Uncaught Exception: TypeError: Cannot read property 'require' of undefined at Object.<anonymous>"
Console output during build
> [email protected] build C:\Users\gilmore_tj\Documents\NodeJS\Electron1
> electron-packager . Electron1 --ignore=node_modules/electron-*
Error output during build
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Electron Packager 8.0.0
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Node v6.3.1
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Host Operating system: win32 (x64)
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Packager Options: {"_":[".","Electron1"],"all":false,"deref-symlinks":true,"download":{"strictSSL":true},"overwrite":false,"prune":true,"ignore":"node_modules/electron-*","dir":".","name":"Electron1","protocols":[]}
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Target Platforms: win32
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Target Architectures: x64
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Inferring app-version from version in package.json
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Inferring target Electron version from electron-prebuilt dependency or devDependency in package.json
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Application name: Electron1
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Target Electron version: 1.4.0
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Ignored path regular expressions: [ 'node_modules/electron-*',
'/node_modules/electron($|/)',
'/node_modules/electron-prebuilt($|/)',
'/node_modules/electron-packager($|/)',
'/\\.git($|/)',
'/node_modules/\\.bin($|/)' ]
Fri, 16 Sep 2016 07:35:18 GMT electron-packager Downloading Electron with options {"strictSSL":true,"platform":"win32","arch":"x64","version":"1.4.0"}
Skipping win32 x64 (output dir already exists, use --overwrite to force)
Package.json command
electron-packager . Electron1 --ignore=node_modules/electron-*
Code provided at https://github.com/TracyGJG/ElectronWindowFault

Can this be of help https://github.com/electron/electron/issues/3708
ALso
--ignore=node_modules/electron-*
shouldn't that be a regexp?
@englishextra Unlikely, it appears he's using a pretty old version of electron-prebuilt, not the electron NPM package.
@TracyGJG there are a few things that are inconsistent in your example:
electron module (that was added in 0.35.0, but you should use the newest Electron release if possible).npm start, you're running main.js, but when you run the packaged app, you're running index.js because Electron runs the script in the main section of package.json (see Electron docs)devDependencies.That being said, this doesn't appear to be an Electron Packager specific problem at this time. You may get better help from the greater Electron community.
@malept thanks for clarification. Also it seems some module has incompatible checking environment Js wrapper.
All working following the good advice received.
The GitHub repo https://github.com/TracyGJG/ElectronWindowFault has now been deleted.
Most helpful comment
@englishextra Unlikely, it appears he's using a pretty old version of
electron-prebuilt, not theelectronNPM package.@TracyGJG there are a few things that are inconsistent in your example:
electronmodule (that was added in 0.35.0, but you should use the newest Electron release if possible).npm start, you're runningmain.js, but when you run the packaged app, you're runningindex.jsbecause Electron runs the script in themainsection ofpackage.json(see Electron docs)devDependencies.That being said, this doesn't appear to be an Electron Packager specific problem at this time. You may get better help from the greater Electron community.