From 83615377dcd7668fe10035eccd6535cf722ce0da Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 12:32:26 -0400 Subject: [PATCH] fix: deprecate ELECTRON_SKIP_BINARY_DOWNLOAD env (#50459) * fix: remove ELECTRON_SKIP_BINARY_DOWNLOAD it is redundant as of electron v42 its purpose was to skip the binary download for post install script but as of electron v42, post install script is gone and replaced with a lazy download it was also slated for removal in [this comment](https://github.com/electron/rfcs/pull/22#issuecomment-3387307743) Co-authored-by: Anirudh Sevugan * docs: remove ELECTRON_SKIP_BINARY_DOWNLOAD section the env is redundant as of electron v42 so docs don't have to mention it anymore Co-authored-by: Anirudh Sevugan * docs: add ELECTRON_SKIP_BINARY_DOWNLOAD to breaking changes Co-authored-by: Anirudh Sevugan --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Anirudh Sevugan --- docs/breaking-changes.md | 3 +++ docs/tutorial/installation.md | 10 ---------- npm/install.js | 4 ---- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 7d4821bdf7..15ff7ceae2 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -70,6 +70,9 @@ npm install electron --save-dev ELECTRON_INSTALL_PLATFORM=mas npx electron . --no ``` +This also means the `ELECTRON_SKIP_BINARY_DOWNLOAD` environment variable is no +longer supported, as its primary purpose was to prevent the `postinstall` script from running. + ### Removed: `quotas` object from `Session.clearStorageData(options)` When calling `Session.clearStorageData(options)`, the `options.quotas` object is no longer supported because it has been diff --git a/docs/tutorial/installation.md b/docs/tutorial/installation.md index 557d16f2fc..7f798a8ad9 100644 --- a/docs/tutorial/installation.md +++ b/docs/tutorial/installation.md @@ -25,16 +25,6 @@ included in the `electron` package: npx install-electron --no ``` -If you want to install your project's dependencies but don't need to use -Electron functionality, you can set the `ELECTRON_SKIP_BINARY_DOWNLOAD` environment -variable to prevent the binary from being downloaded. For instance, this feature can -be useful in continuous integration environments when running unit tests that mock -out the `electron` module. - -```sh -ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install -``` - ## Running Electron ad-hoc If you're in a pinch and would prefer to not use `npm install` in your local diff --git a/npm/install.js b/npm/install.js index 716936591b..5f56d8f632 100755 --- a/npm/install.js +++ b/npm/install.js @@ -11,10 +11,6 @@ const path = require('path'); const { version } = require('./package'); -if (process.env.ELECTRON_SKIP_BINARY_DOWNLOAD) { - process.exit(0); -} - const platformPath = getPlatformPath(); if (isInstalled()) {