fix(update): suppress Node deprecation warnings on Windows

This commit is contained in:
kaitranntt
2025-12-12 16:26:48 -05:00
parent bd39f9a321
commit d616e613c8
+11 -2
View File
@@ -236,8 +236,13 @@ async function performNpmUpdate(
const performUpdate = (): void => {
// On Windows, use shell with full command string to avoid deprecation warning
// Also suppress Node deprecation warnings that may come from package managers
const child = isWindows
? spawn(`${updateCommand} ${updateArgs.join(' ')}`, [], { stdio: 'inherit', shell: true })
? spawn(`${updateCommand} ${updateArgs.join(' ')}`, [], {
stdio: 'inherit',
shell: true,
env: { ...process.env, NODE_NO_WARNINGS: '1' },
})
: spawn(updateCommand, updateArgs, { stdio: 'inherit' });
child.on('exit', (code) => {
@@ -273,7 +278,11 @@ async function performNpmUpdate(
console.log(info('Clearing package cache...'));
// 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.join(' ')}`, [], {
stdio: 'inherit',
shell: true,
env: { ...process.env, NODE_NO_WARNINGS: '1' },
})
: spawn(cacheCommand, cacheArgs, { stdio: 'inherit' });
cacheChild.on('exit', (code) => {