Starting electron application with electron-builder start
See original GitHub issue- Version: 20.8.0
- Target: macOS, Windows
Currently we can publish binaries for Windows and macOS with electron-builder. During development we start our application with electron ./PATH_TO_MAIN.js
and would like to switch to electron-builder start
, since it would consider all the configuration from our electron-builder.json.
Unfortunately we are getting following error with both os (window and macOS)
Error: Cannot find module 'electron-webpack/dev-runner'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at start (/ROOT_PATH/node_modules/electron-builder/out/cli/start.js:10:3)
at _yargs.default.command.command.command.command.command.wrap (/ROOT_PATH/node_modules/electron-builder/out/cli/cli.js:148:239)
at then (/ROOT_PATH/node_modules/electron-builder/out/cli/cli.js:153:97)
From previous event:
at runCallback (timers.js:794:20)
at tryOnImmediate (timers.js:752:5)
at processImmediate [as _immediateCallback] (timers.js:729:5)
From previous event:
at Object.args [as handler] (/ROOT_PATH/node_modules/electron-builder/out/cli/cli.js:153:86)
at Object.runCommand (/ROOT_PATH/node_modules/electron-builder/node_modules/yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/ROOT_PATH/node_modules/electron-builder/node_modules/yargs/yargs.js:1014:30)
at Object.get [as argv] (/ROOT_PATH/node_modules/electron-builder/node_modules/yargs/yargs.js:957:21)
at Object.<anonymous> (/ROOT_PATH/node_modules/electron-builder/out/cli/cli.js:148:373)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
We tried it already with different versions of electron-webpack (1.11.0 , 1.13.0 and 2.0.0)
Does anyone else encounter this problem?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:8 (1 by maintainers)
Top Results From Across the Web
electron-builder
A complete solution to package and build a ready for distribution Electron app for macOS, Windows and Linux with “auto update” support out...
Read more >How To Create Your First Cross-Platform Desktop Application ...
First you'll install Electron to your machine and create the project folder to build the desktop application. To start the Electron ...
Read more >A Comprehensive Guide to Building and Packaging an ...
Before you can package an Electron app, you first must build one. I found building an app to be the easiest part of...
Read more >Quick Start | Electron
This guide will step you through the process of creating a barebones Hello World app in Electron, similar to electron/electron-quick-start.
Read more >Packaging and distributing Electron applications using ...
To package an Electron application, we need to provide electron-builder a configuration that specifies the application name, icons, files to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@develar I think you’re missing the point. The documentation for electron-builder lists a
start
command that doesn’t work, even if you are using electron-webpack.I tracked down the code, and as you can see, it requires
electron-webpack/dev-runner
, which isn’t a valid path. So, you should at best fix the code so it works, or at the very least remove thestart
command and documentation around it.The correct path is
electron-webpack/out/dev/dev-runner
, but as far as I can tell, electron-webpack does not expose a supported public API that you can use to run it outside of the CLI. So if you don’t use the CLI, then you risk running into internal changes that break your code.electron-builder start
is supposed to be used with electron-webpack. You don’t need to use it if you use another framework. Use whatever you want to start app in a dev mode 😃