Skip to content

Commit

Permalink
fix: npm commands on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 committed Oct 10, 2023
1 parent e7f9a5c commit 395f0e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const executeCommand = (command: string, options: ExecuteOptions = {}): P
return new Promise((resolve, reject) => {
const [cmd, ...args] = command.split(" ");

const child = spawn(cmd, args, { stdio: options.silent ? "pipe" : "inherit", cwd: options.cwd });
const child = spawn(cmd === "npm" ? (/^win/.test(process.platform) ? "npm.cmd" : "npm") : cmd, args, {
stdio: options.silent ? "pipe" : "inherit",
cwd: options.cwd,
});
let output = "";
let errorOutput = "";

Expand Down

0 comments on commit 395f0e0

Please sign in to comment.