From 068a9dc45aa23e697264e912cf30ae170e586158 Mon Sep 17 00:00:00 2001 From: Drickon <41375613+Drickon@users.noreply.github.com> Date: Thu, 5 Feb 2026 19:06:26 -0600 Subject: [PATCH] fix: remove --prefer-offline flag to prevent stale cache errors (#1531) The --prefer-offline flag causes npm to use cached package metadata, which can be stale and fail to resolve recently published versions. Also updates deprecated --production flag to --omit=dev. Fixes #1438 --- tools/cli/installers/lib/modules/manager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cli/installers/lib/modules/manager.js b/tools/cli/installers/lib/modules/manager.js index f06f5483..c55dae83 100644 --- a/tools/cli/installers/lib/modules/manager.js +++ b/tools/cli/installers/lib/modules/manager.js @@ -417,7 +417,7 @@ class ModuleManager { if (needsDependencyInstall || wasNewClone || nodeModulesMissing) { const installSpinner = ora(`Installing dependencies for ${moduleInfo.name}...`).start(); try { - execSync('npm install --production --no-audit --no-fund --prefer-offline --no-progress --legacy-peer-deps', { + execSync('npm install --omit=dev --no-audit --no-fund --no-progress --legacy-peer-deps', { cwd: moduleCacheDir, stdio: 'pipe', timeout: 120_000, // 2 minute timeout @@ -442,7 +442,7 @@ class ModuleManager { if (packageJsonNewer) { const installSpinner = ora(`Installing dependencies for ${moduleInfo.name}...`).start(); try { - execSync('npm install --production --no-audit --no-fund --prefer-offline --no-progress --legacy-peer-deps', { + execSync('npm install --omit=dev --no-audit --no-fund --no-progress --legacy-peer-deps', { cwd: moduleCacheDir, stdio: 'pipe', timeout: 120_000, // 2 minute timeout