"Fossies" - the Fresh Open Source Software Archive

Member "electron-4.2.12/docs/api/environment-variables.md" (16 Oct 2019, 3539 Bytes) of package /linux/www/electron-4.2.12.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Environment Variables

Control application configuration and behavior without changing code.

Certain Electron behaviors are controlled by environment variables because they are initialized earlier than the command line flags and the app’s code.

POSIX shell example:

$ electron

Windows console example:

> electron

Production Variables

The following environment variables are intended primarily for use at runtime in packaged Electron applications.


Electron includes support for a subset of Node’s NODE_OPTIONS. The majority are supported with the exception of those which conflict with Chromium’s use of BoringSSL.


export NODE_OPTIONS="--no-warnings --max-old-space-size=2048"

Unsupported options are:


NODE_OPTIONS are explicitly disallowed in packaged apps.


Electron includes a hardcoded API key for making requests to Google’s geocoding webservice. Because this API key is included in every version of Electron, it often exceeds its usage quota. To work around this, you can supply your own Google API key in the environment. Place the following code in your main process file, before opening any browser windows that will make geocoding requests:


For instructions on how to acquire a Google API key, visit this page.

By default, a newly generated Google API key may not be allowed to make geocoding requests. To enable geocoding requests, visit this page.


Disables ASAR support. This variable is only supported in forked child processes and spawned child processes that set ELECTRON_RUN_AS_NODE.


Starts the process as a normal Node.js process.


Don’t attach to the current console session.


Don’t use the global menu bar on Linux.


Set the trash implementation on Linux. Default is gio.

Options: * gvfs-trash * trash-cli * kioclient5 * kioclient

Development Variables

The following environment variables are intended primarily for development and debugging purposes.


Prints Chrome’s internal logging to the console.


When Electron reads from an ASAR file, log the read offset and file path to the system tmpdir. The resulting file can be provided to the ASAR module to optimize file ordering.


Prints the stack trace to the console when Electron crashes.

This environment variable will not work if the crashReporter is started.


Shows the Windows’s crash dialog when Electron crashes.

This environment variable will not work if the crashReporter is started.


When running from the electron package, this variable tells the electron command to use the specified build of Electron instead of the one downloaded by npm install. Usage:

export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Debug