Fix installing plugins that use node-gyp (#291)

* Fix installing plugins that use `node-gyp`

Sets the proper environmental variables to install plugins that have
specific needs for compilation e.g. `nodegit`.

* Get Electron version from `package.json` for plugins env variable
This commit is contained in:
Dylan Frankland 2016-07-19 16:22:56 -07:00 committed by Guillermo Rauch
parent b76e004309
commit b938ad4c58

View file

@ -193,6 +193,9 @@ function install (fn) {
shellEnv().then((env) => {
let registry = exports.getDecoratedConfig().npmRegistry;
if (registry) env.NPM_CONFIG_REGISTRY = registry;
env.npm_config_runtime = 'electron';
env.npm_config_target = require('./package.json').devDependencies['electron-prebuilt'];
env.npm_config_disturl = 'https://atom.io/download/atom-shell';
exec('npm prune && npm install --production', {
cwd: path,
env: env