From ec68c98019fdc9e4394c400711a487839cdb0de1 Mon Sep 17 00:00:00 2001 From: Mark Pleskac Date: Mon, 30 Jun 2025 08:18:16 -0700 Subject: [PATCH 1/2] chore: fix install script for Windows --- lifecycleScripts/install.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js index a07e0335f..05c09f395 100755 --- a/lifecycleScripts/install.js +++ b/lifecycleScripts/install.js @@ -27,6 +27,7 @@ module.exports = function install() { return new Promise(function(resolve, reject) { var spawnedNodePreGyp = spawn(nodePreGyp, args, { + shell: process.platform === "win32", env: Object.assign({}, process.env, { npm_config_node_gyp: path.join(__dirname, "..", "node_modules", "node-gyp", "bin", "node-gyp.js") @@ -60,6 +61,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); }); } From f52d08cc80520394683e89efaad8fcccc346c3e4 Mon Sep 17 00:00:00 2001 From: Mark Pleskac Date: Mon, 30 Jun 2025 08:41:48 -0700 Subject: [PATCH 2/2] chore: use the commit https://github.com/nodegit/nodegit/commit/c12c5a423808e427056d67e0f9b53af8034927c1 --- lifecycleScripts/install.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js index 05c09f395..d4e31cabd 100755 --- a/lifecycleScripts/install.js +++ b/lifecycleScripts/install.js @@ -26,12 +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, { - shell: process.platform === "win32", - 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) {