Skip to content

Node.js based forum software built for the modern web

fix: ./nodebb upgrade on windows

Barış Soner Uşaklı82d380a38d6a
diff --git a/src/cli/upgrade-plugins.js b/src/cli/upgrade-plugins.js
index 92cc980fa2..4949ef619f 100644
--- a/src/cli/upgrade-plugins.js
+++ b/src/cli/upgrade-plugins.js
@@ -148,8 +148,11 @@ async function upgradePlugins(unattended = false) {
if (['y', 'Y', 'yes', 'YES'].includes(result.upgrade)) {
console.log('\nUpgrading packages...');
const args = packageManagerInstallArgs.concat(found.map(suggestObj => `${suggestObj.name}@${suggestObj.suggested}`));
-
- cproc.execFileSync(packageManagerExecutable, args, { stdio: 'ignore' });
+ const options = { stdio: 'ignore' };
+ if (process.platform === 'win32') {
+ options.shell = true;
+ }
+ cproc.execFileSync(packageManagerExecutable, args, options);
} else {
console.log(`${chalk.yellow('Package upgrades skipped')}. Check for upgrades at any time by running "${chalk.green('./nodebb upgrade -p')}".`);
}