electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.48k stars 514 forks source link

npm start did not open the app #607

Closed liudonghua123 closed 5 years ago

liudonghua123 commented 6 years ago

Please describe your issue:

I followed the instruction on https://github.com/electron-userland/electron-forge and start a demo project my-app, but when I run npm start, it didn't open the electron. It did stop on "electron-squirrel-startup processing squirrel command .".

*Console output when you run electron-forge with the environment variable `DEBUG=electron-forge:`. (Instructions on how to do so here). Please include the stack trace if one exists.**

Put the console output here
D:\code\electron\my-app>npm start

> my-app@1.0.0 start D:\code\electron\my-app
> electron-forge start

√ Checking your system
√ Locating Application
√ Preparing native dependencies
√ Launching Application

D:\code\electron\my-app>npm start -v
6.4.1

D:\code\electron\my-app>set DEBUG=*

D:\code\electron\my-app>npm start

> my-app@1.0.0 start D:\code\electron\my-app
> electron-forge start

- Checking your system  electron-forge:check-system checking system, create ~/.skip-forge-system-check to stop doing this +0ms
√ Checking your system
- Locating Application  electron-forge:project-resolver searching for project in: D:\code\electron\my-app +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in D:\code\electron\my-app\package.json +15ms
√ Locating Application
- Preparing native dependencies  electron-rebuild rebuilding with args: [Arguments] {
  '0':
   { buildPath: 'D:\\code\\electron\\my-app',
     electronVersion: '3.0.6',
     arch: 'x64' } } +0ms
  electron-rebuild rebuilding with args: D:\code\electron\my-app 3.0.6 x64 [] false https://atom.io/download/electron [ 'prod', 'optional' ] false +15ms
  electron-rebuild exploring D:\code\electron\my-app\node_modules\electron-squirrel-startup +4ms
  electron-rebuild exploring D:\code\electron\my-app\node_modules\debug +5ms
  electron-rebuild exploring D:\code\electron\my-app\node_modules\debug\node_modules\ms +5ms
  electron-rebuild exploring D:\code\electron\my-app\node_modules\ms +5ms
  electron-rebuild identified prod deps: Set { 'electron-squirrel-startup': true, debug: true, ms: true } +7ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules +11ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@electron-forge +6ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@electron-forge\async-ora\node_modules +5ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@electron-forge\cli\node_modules +10ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@electron-forge\core\node_modules +20ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@electron-forge\installer-dmg\node_modules +12ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@electron-forge\shared-types\node_modules +22ms
\ Preparing native dependencies  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@types +11ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@types\electron-packager\node_modules +5ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\@types\electron-packager\node_modules\@types +7ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\are-we-there-yet\node_modules +15ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\asar\node_modules +11ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\camelcase-keys\node_modules +27ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\concat-stream\node_modules +28ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\cross-spawn\node_modules +10ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\cross-zip\node_modules +4ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\debug\node_modules +8ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\decompress-zip\node_modules +6ms
| Preparing native dependencies  electron-rebuild scanning: D:\code\electron\my-app\node_modules\electron\node_modules +13ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\electron-download\node_modules +3ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\electron-osx-sign\node_modules +8ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\electron-packager\node_modules +7ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\electron-rebuild\node_modules +9ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\electron-winstaller\node_modules +11ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\electron-winstaller\node_modules\asar\node_modules +4ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\execa\node_modules +15ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\execa\node_modules\cross-spawn\node_modules +4ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\external-editor\node_modules +8ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\extract-zip\node_modules +3ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\find-up\node_modules +10ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\flora-colossus\node_modules +4ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\fstream\node_modules +14ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\galactus\node_modules +3ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\get-package-info\node_modules +13ms
/ Preparing native dependencies  electron-rebuild scanning: D:\code\electron\my-app\node_modules\global-prefix\node_modules +26ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\http-signature\node_modules +9ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\inquirer\node_modules +7ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\load-json-file\node_modules +32ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\mkdirp\node_modules +36ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\mksnapshot\node_modules +6ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\mksnapshot\node_modules\fs-extra\node_modules +9ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\node-abi\node_modules +8ms
- Preparing native dependencies  electron-rebuild scanning: D:\code\electron\my-app\node_modules\node-gyp\node_modules +11ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\normalize-package-data\node_modules +7ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\nugget\node_modules +4ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\ora\node_modules +13ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\path-type\node_modules +21ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\redent\node_modules +29ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\request\node_modules +3ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\run-async\node_modules +13ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\spawn-rx\node_modules +16ms
\ Preparing native dependencies  electron-rebuild scanning: D:\code\electron\my-app\node_modules\temp\node_modules +22ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\touch\node_modules +13ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\verror\node_modules +17ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\wide-align\node_modules +9ms
  electron-rebuild scanning: D:\code\electron\my-app\node_modules\yargs-parser\node_modules +16ms
√ Preparing native dependencies
√ Launching Application

Thu, 25 Oct 2018 03:28:11 GMT electron-squirrel-startup processing squirrel command `.`

What command line arguments are you passing?

Put the arguments here

What does your config.forge data in package.json look like?

Paste the config.forge JSON object here

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to reproduce your problem. Using electron-forge init is a good starting point, if that is not the source of your problem.

vic2r commented 5 years ago

Hi, I have the same problem on Win 10 64bit.

I just started using electron, and electron-forge. To reproduce, just start from scratch on a new machine and follow the electron-forge page. image After running those commands, there are a bunch of error messages and the app window never appears.

Separately, I was able to get the regular electron demo to work from their man page: image

malept commented 5 years ago

What version of Electron Forge is this?

liudonghua123 commented 5 years ago

If you are using node 11, then you should use electron 3.0.8 or newer. see more details on https://github.com/electron/electron/pull/15470

malept commented 5 years ago

If that's the issue, I'm inclined to close this as not a bug in Electron Forge.

liudonghua123 commented 5 years ago

@malept, @vic2r I tested it and confirmed what I guess.

vic2r commented 5 years ago

Ok, thank you guys for resolving this issue for me. I am still learning.

I am on node version 11.x. I thought I was on electron 3.0.8. When I install electron-forge and look the json package.json (there are many nested version under folders called "node_modules" it always says 2.0.8. I've tried googling, and several commands to update electron inside my test projects. I'm sure it's something simple, can either of you point me in the right direction? How do I "use electron version 3.0.8 or newer"?

Thanks again to both of you.

malept commented 5 years ago

Assuming you're using Electron Forge v5, update the dependency of electron-prebuilt-compile in the devDependencies section of your package.json to 3.0.8 and then run npm update.

If you need more assistance, you can ask in one of the Electron community forums.