From bace084e75442a4321659fceea19b89ffdfa9b6b Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Fri, 12 Dec 2025 16:24:49 -0500 Subject: [PATCH] fix(update): avoid Node deprecation warning on Windows spawn --- src/commands/update-command.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/commands/update-command.ts b/src/commands/update-command.ts index 38225ca1..5f344dcb 100644 --- a/src/commands/update-command.ts +++ b/src/commands/update-command.ts @@ -232,11 +232,13 @@ async function performNpmUpdate( console.log(info(`${isReinstall ? 'Reinstalling' : 'Updating'} via ${packageManager}...`)); console.log(''); + const isWindows = process.platform === 'win32'; + const performUpdate = (): void => { - const child = spawn(updateCommand, updateArgs, { - stdio: 'inherit', - shell: process.platform === 'win32', - }); + // On Windows, use shell with full command string to avoid deprecation warning + const child = isWindows + ? spawn(`${updateCommand} ${updateArgs.join(' ')}`, [], { stdio: 'inherit', shell: true }) + : spawn(updateCommand, updateArgs, { stdio: 'inherit' }); child.on('exit', (code) => { if (code === 0) { @@ -269,10 +271,10 @@ async function performNpmUpdate( if (cacheCommand && cacheArgs) { console.log(info('Clearing package cache...')); - const cacheChild = spawn(cacheCommand, cacheArgs, { - stdio: 'inherit', - shell: process.platform === 'win32', - }); + // On Windows, use shell with full command string to avoid deprecation warning + const cacheChild = isWindows + ? spawn(`${cacheCommand} ${cacheArgs.join(' ')}`, [], { stdio: 'inherit', shell: true }) + : spawn(cacheCommand, cacheArgs, { stdio: 'inherit' }); cacheChild.on('exit', (code) => { if (code !== 0) {