Skip to content

Commit 001181c

Browse files
authored
fix: handle npm.cmd on Windows in runCommand (#300)
1 parent ac5cec0 commit 001181c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scripts/start.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const path = require('node:path');
99

1010
function runCommand(command, args, options) {
1111
return new Promise((resolve, reject) => {
12+
// On Windows, npm is a batch file and needs a shell
13+
if (process.platform === 'win32' && command === 'npm') {
14+
command = `${command}.cmd`;
15+
options = { ...options, shell: true };
16+
}
1217
const child = spawn(command, args, options);
1318

1419
// Pipe stderr to the parent process's stderr if it's available.

0 commit comments

Comments
 (0)