Fix npm plugin installation on Windows

cshd
Dragory 2020-11-04 23:00:11 +02:00
parent fcad5df6bf
commit e5172612e9
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 6 additions and 1 deletions

View File

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