diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js index a07e0335f..d4e31cabd 100755 --- a/lifecycleScripts/install.js +++ b/lifecycleScripts/install.js @@ -26,11 +26,13 @@ module.exports = function install() { } return new Promise(function(resolve, reject) { + const gypPath = path.join(__dirname, "..", "node_modules", "node-gyp", "bin", "node-gyp.js"); var spawnedNodePreGyp = spawn(nodePreGyp, args, { - env: Object.assign({}, process.env, { - npm_config_node_gyp: path.join(__dirname, "..", "node_modules", - "node-gyp", "bin", "node-gyp.js") - }) + env: { + ...process.env, + npm_config_node_gyp: gypPath + }, + shell: process.platform === "win32" }); spawnedNodePreGyp.stdout.on("data", function(data) { @@ -60,6 +62,6 @@ if (require.main === module) { .catch(function(e) { console.error("[nodegit] ERROR - Could not finish install"); console.error("[nodegit] ERROR - finished with error code: " + e); - process.exit(e); + process.exit(1); }); }