From b938ad4c58ecaa26aae3a6a32b9a5923fa711836 Mon Sep 17 00:00:00 2001 From: Dylan Frankland Date: Tue, 19 Jul 2016 16:22:56 -0700 Subject: [PATCH] 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 --- plugins.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins.js b/plugins.js index 3c2510b2..f2b16035 100644 --- a/plugins.js +++ b/plugins.js @@ -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