fix: npm install error on Windows (spawn EINVAL) (#1214)

This commit is contained in:
Krista Vlastou
2025-03-26 20:58:46 +02:00
committed by GitHub
parent 3d3af13979
commit 4b7e09e157
3 changed files with 583 additions and 565 deletions
+1
View File
@@ -0,0 +1 @@
{}
+580 -564
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -399,7 +399,8 @@ class Kernel extends AdvancedBase {
}
async run_npm_install (path) {
const proc = spawn('npm', ['install'], { cwd: path, stdio: 'inherit' });
const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm";
const proc = spawn(npmCmd, ["install"], { cwd: path, shell: true, stdio: "inherit" });
return new Promise((rslv, rjct) => {
proc.on('close', code => {
if ( code !== 0 ) {