📝 Installation
This commit is contained in:
parent
3c66e810c0
commit
e98637596d
1 changed files with 21 additions and 13 deletions
|
@ -1,8 +1,6 @@
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
> Tips for installing Electron
|
To install prebuilt Electron binaries, use [`npm`][npm].
|
||||||
|
|
||||||
To install prebuilt Electron binaries, use [`npm`](https://docs.npmjs.com/).
|
|
||||||
The preferred method is to install Electron as a development dependency in your
|
The preferred method is to install Electron as a development dependency in your
|
||||||
app:
|
app:
|
||||||
|
|
||||||
|
@ -10,9 +8,8 @@ app:
|
||||||
npm install electron --save-dev
|
npm install electron --save-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
See the
|
See the [Electron versioning doc][versioning] for info on how to
|
||||||
[Electron versioning doc](electron-versioning.md)
|
manage Electron versions in your apps.
|
||||||
for info on how to manage Electron versions in your apps.
|
|
||||||
|
|
||||||
## Global Installation
|
## Global Installation
|
||||||
|
|
||||||
|
@ -41,11 +38,12 @@ npm install --platform=win32 electron
|
||||||
|
|
||||||
## Proxies
|
## Proxies
|
||||||
|
|
||||||
If you need to use an HTTP proxy you can [set these environment variables](https://github.com/request/request/tree/f0c4ec061141051988d1216c24936ad2e7d5c45d#controlling-proxy-behaviour-using-environment-variables).
|
If you need to use an HTTP proxy you can [set these environment variables][proxy-env].
|
||||||
|
|
||||||
## Custom Mirrors and Caches
|
## Custom Mirrors and Caches
|
||||||
During installation, the `electron` module will call out to [`electron-download`](https://github.com/electron-userland/electron-download) to download prebuilt
|
During installation, the `electron` module will call out to
|
||||||
binaries of Electron for your platform. It will do so by contacting GitHub's
|
[`electron-download`][electron-download] to download prebuilt binaries of
|
||||||
|
Electron for your platform. It will do so by contacting GitHub's
|
||||||
release download page (`https://github.com/electron/electron/releases/tag/v$VERSION`,
|
release download page (`https://github.com/electron/electron/releases/tag/v$VERSION`,
|
||||||
where `$VERSION` is the exact version of Electron).
|
where `$VERSION` is the exact version of Electron).
|
||||||
|
|
||||||
|
@ -111,19 +109,21 @@ network problems. The best resolution is to try switching networks, or
|
||||||
just wait a bit and try installing again.
|
just wait a bit and try installing again.
|
||||||
|
|
||||||
You can also attempt to download Electron directly from
|
You can also attempt to download Electron directly from
|
||||||
[electron/electron/releases](https://github.com/electron/electron/releases)
|
[electron/electron/releases][releases]
|
||||||
if installing via `npm` is failing.
|
if installing via `npm` is failing.
|
||||||
|
|
||||||
If installation fails with an `EACCESS` error you may need to
|
If installation fails with an `EACCESS` error you may need to
|
||||||
[fix your npm permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions).
|
[fix your npm permissions][npm-permissions].
|
||||||
|
|
||||||
If the above error persists, the [unsafe-perm](https://docs.npmjs.com/misc/config#unsafe-perm) flag may need to be set to true:
|
If the above error persists, the [unsafe-perm][unsafe-perm] flag may need to be
|
||||||
|
set to true:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo npm install electron --unsafe-perm=true
|
sudo npm install electron --unsafe-perm=true
|
||||||
```
|
```
|
||||||
|
|
||||||
On slower networks, it may be advisable to use the `--verbose` flag in order to show download progress:
|
On slower networks, it may be advisable to use the `--verbose` flag in order to
|
||||||
|
show download progress:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install --verbose electron
|
npm install --verbose electron
|
||||||
|
@ -131,3 +131,11 @@ npm install --verbose electron
|
||||||
|
|
||||||
If you need to force a re-download of the asset and the SHASUM file set the
|
If you need to force a re-download of the asset and the SHASUM file set the
|
||||||
`force_no_cache` environment variable to `true`.
|
`force_no_cache` environment variable to `true`.
|
||||||
|
|
||||||
|
[npm]: https://docs.npmjs.com
|
||||||
|
[versioning]: ./electron-versioning.md
|
||||||
|
[releases]: https://github.com/electron/electron/releases
|
||||||
|
[proxy-env]: https://github.com/request/request/tree/f0c4ec061141051988d1216c24936ad2e7d5c45d#controlling-proxy-behaviour-using-environment-variables
|
||||||
|
[electron-download]: https://github.com/electron-userland/electron-download
|
||||||
|
[npm-permissions]: https://docs.npmjs.com/getting-started/fixing-npm-permissions
|
||||||
|
[unsafe-perm]: https://docs.npmjs.com/misc/config#unsafe-perm
|
Loading…
Add table
Add a link
Reference in a new issue