diff --git a/npm/README.md b/npm/README.md index 8d23ff6e78a4..c40ed94a1859 100644 --- a/npm/README.md +++ b/npm/README.md @@ -39,6 +39,11 @@ electron 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 want to change the architecture that is downloaded (e.g., `ia32` on an `x64` machine), you can use the `--arch` flag with npm install or set the `npm_config_arch` environment variable: +``` +npm install --arch=ia32 electron-prebuilt +``` + ## About Works on Mac, Windows and Linux OSes that Electron supports (e.g. Electron [does not support Windows XP](https://github.com/atom/electron/issues/691)). diff --git a/npm/install.js b/npm/install.js index fac56ae5fab9..034153b60566 100755 --- a/npm/install.js +++ b/npm/install.js @@ -23,11 +23,8 @@ var paths = { if (!paths[platform]) throw new Error('Unknown platform: ' + platform) -if (process.env.npm_config_arch) { - download({version: version, arch: process.env.npm_config_arch}, extractFile) -} else { - download({version: version}, extractFile) -} +// downloads if not cached +download({version: version, arch: process.env.npm_config_arch}, extractFile) // unzips and makes path.txt point at the correct executable function extractFile (err, zipPath) {