Merge pull request #10225 from electron/more-installation-tips

add more installation tips
This commit is contained in:
Zeke Sikelianos 2017-08-08 20:55:15 -07:00 committed by GitHub
commit 1e9109f3c6

View file

@ -33,6 +33,13 @@ If you want to change the architecture that is downloaded (e.g., `ia32` on an
npm install --arch=ia32 electron npm install --arch=ia32 electron
``` ```
In addition to changing the architecture, you can also specify the platform
(e.g., `win32`, `linux`, etc.) using the `--platform` flag:
```shell
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](https://github.com/request/request/tree/f0c4ec061141051988d1216c24936ad2e7d5c45d#controlling-proxy-behaviour-using-environment-variables).
@ -45,12 +52,27 @@ installation errors.
In almost all cases, these errors are the result of network problems and not In almost all cases, these errors are the result of network problems and not
actual issues with the `electron` npm package. Errors like `ELIFECYCLE`, actual issues with the `electron` npm package. Errors like `ELIFECYCLE`,
`EAI_AGAIN`, `ECONNRESET`, and `ETIMEDOUT` are all indications of such `EAI_AGAIN`, `ECONNRESET`, and `ETIMEDOUT` are all indications of such
network problems. The best resolution is to try switching networks, or 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](https://github.com/electron/electron/releases)
if installing via `npm` is failing. if installing via `npm` is failing.
If installation fails with an `EACCESS` error you may need to
[fix your npm permissions](https://docs.npmjs.com/getting-started/fixing-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:
```sh
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:
```sh
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` enviroment variable to `true`. `force_no_cache` enviroment variable to `true`.