Skip to content

Commit 34f2407

Browse files
chore: update ref to docs (🤖) (#887)
Co-authored-by: electron-website-docs-updater[bot] <166660481+electron-website-docs-updater[bot]@users.noreply.github.com>
1 parent 2e8b482 commit 34f2407

4 files changed

Lines changed: 52 additions & 19 deletions

File tree

‎docs/latest/.sha‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6ee299c9eec451d1efcab4be09c3b3e4a028d2c9
1+
f8479ece3d5a9b8338c9b084aba7f79e0be34d5d

‎docs/latest/faq.md‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,28 @@ network problems. The best resolution is to try switching networks, or
1919
wait a bit and try installing again.
2020

2121
You can also attempt to download Electron directly from
22-
[electron/electron/releases](https://github.com/electron/electron/releases)
22+
[GitHub Releases](https://github.com/electron/electron/releases)
2323
if installing via `npm` is failing.
2424

25-
## When will Electron upgrade to latest Chrome?
25+
If you need to install Electron through a custom mirror or proxy, see
26+
the [Advanced Installation](./tutorial/installation.md) documentation for more details.
2627

27-
The Chrome version of Electron is usually bumped within one or two weeks after
28-
a new stable Chrome version gets released. This estimate is not guaranteed and
29-
depends on the amount of work involved with upgrading.
28+
## How are Electron binaries downloaded?
3029

31-
Only the stable channel of Chrome is used. If an important fix is in beta or dev
32-
channel, we will back-port it.
30+
When you run `npm install electron`, the Electron binary for the corresponding version is downloaded
31+
into your project's `node_modules` folder via npm's `postinstall` lifecycle script.
3332

34-
For more information, please see the [security introduction](tutorial/security.md).
33+
This logic is handled by the [`@electron/get`](https://github.com/electron/get) utility package
34+
under the hood.
35+
36+
## When will Electron upgrade to latest Chromium?
37+
38+
Every new major version of Electron releases with a Chromium major version upgrade. By releasing every
39+
8 weeks, Electron is able to pull in every other major Chromium release on the very same day that it
40+
releases upstream. Security fixes will be backported to stable release channels ahead of time.
41+
42+
See the [Electron Releases](./tutorial/electron-timelines.md) documentation for more details or
43+
[releases.electronjs.org](https://releases.electronjs.org) to see our Release Status dashboard.
3544

3645
## When will Electron upgrade to latest Node.js?
3746

‎docs/latest/tutorial/installation.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ any dependencies in your app will not be installed.
3333

3434
## Customization
3535

36-
If you want to change the architecture that is downloaded (e.g., `ia32` on an
37-
`x64` machine), you can use the `--arch` flag with npm install or set the
36+
If you want to change the architecture that is downloaded (e.g., `x64` on an
37+
`arm64` machine), you can use the `--arch` flag with npm install or set the
3838
`npm_config_arch` environment variable:
3939

4040
```shell
41-
npm install --arch=ia32 electron
41+
npm install --arch=x64 electron
4242
```
4343

4444
In addition to changing the architecture, you can also specify the platform
@@ -67,7 +67,7 @@ where `$VERSION` is the exact version of Electron).
6767
If you are unable to access GitHub or you need to provide a custom build, you
6868
can do so by either providing a mirror or an existing cache directory.
6969

70-
#### Mirror
70+
### Mirror
7171

7272
You can use environment variables to override the base URL, the path at which to
7373
look for Electron binaries, and the binary filename. The URL used by `@electron/get`
@@ -102,7 +102,7 @@ Electron release you may have to set `electron_use_remote_checksums=1` directly,
102102
or configure it in a `.npmrc` file, to force Electron to use the remote `SHASUMS256.txt`
103103
file to verify the checksum instead of the embedded checksums.
104104

105-
#### Cache
105+
### Cache
106106

107107
Alternatively, you can override the local cache. `@electron/get` will cache
108108
downloaded binaries in a local directory to not stress your network. You can use
@@ -127,7 +127,7 @@ The cache contains the version's official zip file as well as a checksum, and is
127127
│ └── electron-v15.3.1-darwin-x64.zip
128128
```
129129

130-
## Skip binary download
130+
## Postinstall script
131131

132132
Under the hood, Electron's JavaScript API binds to a binary that contains its
133133
implementations. Because this binary is crucial to the function of any Electron app,

‎docs/latest/tutorial/tutorial-2-first-app.md‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,45 @@ There are a few rules to follow for the purposes of this tutorial:
5555
- _author_, _license_, and _description_ can be any value, but will be necessary for
5656
[packaging][packaging] later on.
5757

58+
:::caution Install dependencies with a regular `node_modules` folder
59+
60+
Electron's packaging toolchain requires the `node_modules` folder to be physically on disk in the
61+
way that npm installs Node dependencies. By default, [Yarn Berry](https://yarnpkg.com/) and
62+
[pnpm](http://pnpm.io/) both use alternative installation strategies.
63+
64+
Therefore, you must set [`nodeLinker: node-modules`](https://yarnpkg.com/configuration/yarnrc#nodeLinker)
65+
in Yarn or [`nodeLinker: hoisted`](https://pnpm.io/settings#nodelinker) in pnpm if you are using
66+
those package managers.
67+
68+
:::
69+
5870
Then, install Electron into your app's **devDependencies**, which is the list of external
5971
development-only package dependencies not required in production.
6072

61-
:::info Why is Electron a devDependency?
73+
:::info Why is Electron a dev dependency?
6274

63-
This may seem counter-intuitive since your production code is running Electron APIs.
64-
However, packaged apps will come bundled with the Electron binary, eliminating the need to specify
65-
it as a production dependency.
75+
This may seem counter-intuitive since your production code is running Electron APIs. Under the hood,
76+
Electron's JavaScript API binds to a binary that contains its implementations. The packaging step for
77+
Electron handles the bundling of this binary, eliminating the need to specify it as a production
78+
dependency.
6679

6780
:::
6881

6982
```sh npm2yarn
7083
npm install electron --save-dev
7184
```
7285

86+
:::warning
87+
88+
In order to correctly install Electron, you need to ensure that its `postinstall` lifecycle
89+
script is able to run. This means avoiding the `--ignore-scripts` flag on npm and allowlisting
90+
`electron` to run build scripts on other package managers.
91+
92+
This is likely to change in a future version of Electron. See
93+
[electron/rfcs#22](https://github.com/electron/rfcs/pull/22) for more details.
94+
95+
:::
96+
7397
Your package.json file should look something like this after initializing your package
7498
and installing Electron. You should also now have a `node_modules` folder containing
7599
the Electron executable, as well as a `package-lock.json` lockfile that specifies

0 commit comments

Comments
 (0)