Can't set Electron environmental variables in packaged application without Webpack?
See original GitHub issueIs it possible to pass ELECTRON_RUN_AS_NODE=true
and ELECTRON_NO_ATTACH_CONSOLE=true
without setting up Webpack? If so, can someone explain how? I’ve searched all day and tried a bunch of ideas I had, but no luck with any of them.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Can't set Electron environmental variables in packaged ...
Basically, I've got an application using stdio that works on Mac, but not on Windows. I'm trying to troubleshoot it, but changing to...
Read more >Environment variable is undefined in electron even it has ...
So I decided to place that value in environment variable and tried to achieve that using webpack. DefinePlugin({}). const Electron = require(" ...
Read more >Update json file with Environment Variable - Compiling ENV ...
In the Electron App that we develop at our company, there is no Webpack configured for bundling the App, since the App is...
Read more >Environment Variables - Electron
Certain Electron behaviors are controlled by environment variables because they are initialized earlier than the command line flags and the app's code.
Read more >Creating an Electron application from scratch
An Electron application is an npm project with the electron package as a dependency. Our first steps will be creating the npm project...
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
Setting
ELECTRON_RUN_AS_NODE
andELECTRON_NO_ATTACH_CONSOLE
in webpack will do absolutely nothing to Electron. Setting them in JS withprocess.env. ELECTRON_NO_ATTACH_CONSOLE = true
in your main process will also do nothing.Those two environment variables to be set before your app is launched in the initial environment. I.e. you need to set those variables either from your launcher script or your terminal before launching
@MarshallOfSound thank you so much. I searched for a looooong time and couldn’t find a clear explanation which left my somewhat shooting in the dark.
It would be great to add that information in some form here: https://electronjs.org/docs/api/environment-variables