From 575bf7f0aaaf8ae245bf02ba45a6b90ace6bf588 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Tue, 15 Jun 2021 17:24:15 -0700 Subject: [PATCH] docs: clarify use of ELECTRON_SKIP_BINARY_DOWNLOAD --- docs/tutorial/installation.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/tutorial/installation.md b/docs/tutorial/installation.md index a75daa68246c1..87b6623fd7bf4 100644 --- a/docs/tutorial/installation.md +++ b/docs/tutorial/installation.md @@ -135,14 +135,18 @@ a text file. A typical cache might look like this: ## Skip binary download -When installing the `electron` NPM package, it automatically downloads the electron binary. - -This can sometimes be unnecessary, e.g. in a CI environment, when testing another component. - -To prevent the binary from being downloaded when you install all npm dependencies you can set the environment variable `ELECTRON_SKIP_BINARY_DOWNLOAD`. -E.g.: - -```sh +Under the hood, Electron's JavaScript API binds to a binary that contains its +implementations. Because this binary is crucial to the function of any Electron app, +it is downloaded by default in the `postinstall` step every time you install `electron` +from the npm registry. + +However, 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 npm2yarn ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install ```