From e5172612e9ba6879660a99294ada78a179e4d8f7 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 4 Nov 2020 23:00:11 +0200 Subject: [PATCH] Fix npm plugin installation on Windows --- src/plugins.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins.js b/src/plugins.js index 0537de5..b09392e 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -17,7 +17,12 @@ const pluginSources = { console.log(`Installing ${plugins.length} plugins from NPM...`); let stderr = ""; - const npmProcess = childProcess.spawn("npm", ["install", "--verbose", "--no-save", ...plugins], { cwd: process.cwd() }); + const npmProcessName = /^win/.test(process.platform) ? "npm.cmd" : "npm"; + const npmProcess = childProcess.spawn( + npmProcessName, + ["install", "--verbose", "--no-save", ...plugins], + { cwd: process.cwd() } + ); npmProcess.stderr.on("data", data => { stderr += String(data) }); npmProcess.on("close", code => { if (code !== 0) {