+0
Daily
+1
Weekly
299
stars
85
forks
12
watchers
740
prs
187
issues
0
releases
README
Electron Build Tools This repository contains helper/wrapper scripts to make building Electron easier. Table of Contents - Installation - Quickstart - Concepts - Core workflow: init · sync · build - Running Electron: start · node · debug · test · npm - Inspecting state: show · shell - Working with code: patches · patch-merge-driver · register-patches-merge-driver · open · pr · download-dist · backport · cherry-pick · rcv · auto-roll - Managing configs: use · remove · sanitize-config · worktree · load-macos-sdk - Infrastructure: depot-tools · gh-auth · auto-update - Configuration file reference - Environment variables - Shell completion - Advanced Installation A handful of prerequisites, such as git, python, and npm, are required for building Electron itself; these can be found in [Platform Prerequisites][platform-prerequisites]. npm can be used with build-tools itself as well, but we've configured it to run with yarn, so we also recommend you install it to your system. From here, you'll need a command-line prompt. On Mac and Linux, this will be a terminal with a shell, e.g. bash or zsh. You can also use these on Windows if you install them, or use built-in tools like Windows' Command Prompt. Please note that build-tools (due to nested dependencies) might not work properly in PowerShell; please use cmd on Windows for optimum results. sh Install build-tools package globally: npm i -g @electron/build-tools [!NOTE] The @electron/build-tools npm package is a thin wrapper for the actual build-tools scripts. Its code lives in the electron/build-tools-installer repository. Quickstart sh The 'Hello, World!' of build-tools: get and build main Choose the directory where Electron's source and build files will reside. You can specify any path you like; this command defaults to $PWD/electron. If you're going to use multiple branches, you may want something like: --root=~/electron/branch (e.g. ~/electron-gn/main) e init --root=~/electron --bootstrap testing That command's going to run for awhile. While you're waiting, grab a cup of hot caffeine and read about what your computer is doing. Concepts Electron's build-tools command is named e. Like [nvm][nvm] and git, you'll invoke e with commands and subcommands. See e --help or e help for more details on any command. e also borrows another inspiration from nvm: having multiple configurations that you can switch between so that one is the current, active configuration. Many choices go into an Electron build: - Which Electron branch is used (e.g. main, 36-x-y) - Which [.gn config file][gn-configs] is imported (e.g. testing or release) - Any compile-time options (e.g. Clang's [asan or tsan][sanitizers]) e holds all these variables together in a build configuration. You can have multiple build configurations and manage them in a way similar to nvm: | nvm | e | Description | |:---------------------|:------------------
Top issues
#269windows build fails randomly6 comments · 2021-03-15#683Cannot find fnm installed npm and npx3 comments · 2024-11-24#179Create `e lint` to make linting available to users using exclusively build-tools3 comments · 2020-09-16#790[for `npm test` electron src] No module named 'dbusmock' and 'gi'1 comments · 2026-01-05#779err: fork/exec /Users/lucad/.electron_build_tools/third_party/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python3/bin/python3.exe: The system cannot find the path specified.1 comments · 2025-11-17#775ERROR Error: Command failed: npx yarn --prod1 comments · 2025-11-10#762Build tools default to `x64` on `arm64` Windows1 comments · 2025-10-12#688Unable to initialize - giving up trying to rename expand.exe1 comments · 2025-01-10