From 0b4bd934ca2251252004827ccc1cf811b9e358c3 Mon Sep 17 00:00:00 2001 From: alex3347 <821882886@qq.com> Date: Sun, 20 May 2018 13:32:10 +0800 Subject: [PATCH] add command on win platform --- src/util/spawn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/spawn.js b/src/util/spawn.js index 99527b1..655b9d9 100644 --- a/src/util/spawn.js +++ b/src/util/spawn.js @@ -4,7 +4,7 @@ const childProcess = require('child_process'); * Spawn a child process with a callback when the process exits */ module.exports = function spawn(task, args, onClose) { - const child = childProcess.spawn('npm', args, { + const child = childProcess.spawn(process.platform === 'win32' ? 'npm.cmd' : 'npm', args, { stdio: 'inherit' });