Browse Source

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

Krista Vlastou 1 month ago
parent
commit
4b7e09e157
3 changed files with 345 additions and 244 deletions
  1. 1 0
      mod_packages/testex/package.json
  2. 342 243
      package-lock.json
  3. 2 1
      src/backend/src/Kernel.js

+ 1 - 0
mod_packages/testex/package.json

@@ -0,0 +1 @@
+{}

File diff suppressed because it is too large
+ 342 - 243
package-lock.json


+ 2 - 1
src/backend/src/Kernel.js

@@ -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 ) {

Some files were not shown because too many files changed in this diff