FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix node-pre-gyp spawn on windows with node 18+ · figma/nodegit@83e38fa · GitHub

Repository navigation

Commit 83e38fa

Browse files
authored andcommitted
fix node-pre-gyp spawn on windows with node 18+
spawning cmd files without shell: true wasn't really allowed before, but not it's expressly disallowed because of a recent vulnerability reported to node
1 parent 476d81f commit 83e38fa

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎lifecycleScripts/install.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ module.exports = function install() {
2626
}
2727

2828
return new Promise(function(resolve, reject) {
29+
const gypPath = path.join(__dirname, "..", "node_modules", "node-gyp", "bin", "node-gyp.js");
2930
var spawnedNodePreGyp = spawn(nodePreGyp, args, {
30-
env: Object.assign({}, process.env, {
31-
npm_config_node_gyp: path.join(__dirname, "..", "node_modules",
32-
"node-gyp", "bin", "node-gyp.js")
33-
})
31+
env: {
32+
...process.env,
33+
npm_config_node_gyp: gypPath
34+
},
35+
shell: process.platform === "win32"
3436
});
3537

3638
spawnedNodePreGyp.stdout.on("data", function(data) {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL