Fix npm plugin installation on Windows
parent
fcad5df6bf
commit
e5172612e9
|
@ -17,7 +17,12 @@ const pluginSources = {
|
||||||
console.log(`Installing ${plugins.length} plugins from NPM...`);
|
console.log(`Installing ${plugins.length} plugins from NPM...`);
|
||||||
|
|
||||||
let stderr = "";
|
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.stderr.on("data", data => { stderr += String(data) });
|
||||||
npmProcess.on("close", code => {
|
npmProcess.on("close", code => {
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
|
|
Loading…
Reference in New Issue