
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
electron-installer
Advanced tools

electron-installer is a command-line utility written in Node.js that streamlines the process of preparing an Electron distribution.
This utility is intended for use in automated build pipelines or for development and testing purposes.
npm install electron-installer -g
Usage: electron-installer [options]
Options:
--help Show this help message and exit.
--target-dir Specify a target directory to install to.
--version Specify a version to install (e.g 23.0.0)
--no-cache Disable caching of downloaded builds.
--clear-cache Clears the cache of downloaded builds.
--platform <string> Override the platform to install for.
--arch <string> Override the architecture to install for.
--exclude <pattern> Exclude files matching the given pattern.
--locale <a,b,c..> Define which locales to include in the build (defaults: all).
Using the --version <version> option you can specify a specific version of Electron to install. This should be a valid version number such as 23.0.0 or 24.0.0-alpha.1.
electron-installer --version 24.0.0-alpha.1
If no version is specified, the latest stable version will be installed. This is determined by querying the directory listing of the download server.
electron-installer # No version, latest is installed.
By default, Electron will be installed in the current working directory. To specify your own target directory, use the --target-dir option.
electron-installer --target-dir /path/to/target # Installs to /path/to/target.
Keep in mind that files will be overwritten if they already exist in the target directory.
The --target-directory option also supports some substitution variables that can be used to dynamically generate the target directory.
| Variable | Description | Example |
|---|---|---|
{version} | The version of Electron being installed. | 23.0.0 |
{platform} | The platform being installed for. | win32 |
{arch} | The architecture being installed for. | x64 |
{package} | The name of the package being installed. | electron-v24.0.0-alpha.1-win32-arm64 |
electron-installer --target-dir="/{package}" # Installs to /electron-v23.0.0-win32-x64
electron-installer --target-dir="/{version}/{platform}" # Installs to /23.0.0/win32
By default, the platform and architecture of the current system will be used. If you wish to override this, use the --platform and --arch options.
electron-installer --platform win32 --arch x64 # Installs latest stable build for Windows x64.
At the time of writing, the following platforms and architectures are supported:
| Platform | Architecture |
|---|---|
win32 | x64, ia32, arm64 |
linux | x64, arm64, armv7l |
darwin | x64, arm64 |
mas | x64, arm64 |
This utility does not validate against this table, and will attempt to download the build regardless of the platform or architecture specified. If the build does not exist, the download will fail.
By default, downloaded builds are cached to the operating system's temporary directory. Installing the same version multiple times will re-use the cached build, avoiding unnecessary downloads.
Path: os.tmpdir() + '/electron-installer-cache/' + package
To disable this behavior, use the --no-cache option. The cache will not be checked or updated when this option is used.
electron-installer --no-cache # Disables caching.
Additionally, the --clear-cache option can be used to clear the cache before a build starts. The cache will still be used unless --no-cache is also set.
electron-installer --clear-cache # Clears the cache before installing.
Providing the --exclude <pattern> option allows you to exclude files that match the pattern from the build. The pattern should be a valid regular expression.
electron-installer --exclude "^ffmpeg.dll$" # Excludes ffmpeg.dll from the build.
Notes on file exclusion:
By default, builds come with locale files for all languages supported by Chromium. According to the developer of nw.js, it is safe to remove locale files that you won't be using.
electron-installer makes this simple with the --locale <locales> option, where <locales> is a comma-separated list of locales to include.
You can find a list of locales supported by Chromium here.
electron-installer --locale "sw,en-GB,en_US"
Notes on locale:
en (OSX variation) for en-US, electron-installer will automatically adjust this when installing for OSX.electron-installer will automatically adjust them depending on the target platform (e.g en-gb == en_gb).en-GB == en-gb).Feedback, bug reports and contributions are welcome. Please use the GitHub issue tracker and follow the guidelines found in the CONTRIBUTING file.
The code in this repository is licensed under the ISC license. See the LICENSE file for more information.
FAQs
Cross-platform CLI tool for installing Electron distributions
We found that electron-installer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.