From dc1926030a517cdd35d66dd79297a8573be906d0 Mon Sep 17 00:00:00 2001 From: Waishnav <86405648+Waishnav@users.noreply.github.com> Date: Fri, 30 Oct 2026 13:56:06 +0530 Subject: [PATCH] fix(install): revalidate npm metadata so updates get the new release npm reuses cached package metadata, so running the installer shortly after a release (or to update) could resolve the dist-tag to the previous version. Right after 1.1.0-beta.6 was published, a fresh install still got 1.1.0-beta.5. --prefer-online revalidates the cache. Co-Authored-By: Claude Opus 5.5 --- install/install.ps1 | 3 ++- install/install.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/install/install.ps1 b/install/install.ps1 index b28ee957d..fe9f802d9 100644 --- a/install/install.ps1 +++ b/install/install.ps1 @@ -115,8 +115,9 @@ $prefix = Join-Path $InstallDir "npm" New-Item -ItemType Directory -Path $prefix -Force | Out-Null # npm resolves `node` from PATH, so put the selected Node first. # DevSpace and its dependencies ship prebuilt binaries, so no install scripts are needed. +# --prefer-online revalidates cached metadata, so a rerun right after a release installs that release. $env:Path = "$NodeDir;$env:Path" -& $Npm install --global --prefix $prefix --ignore-scripts --no-fund --no-audit --no-update-notifier --loglevel=error $PackageSpec +& $Npm install --global --prefix $prefix --ignore-scripts --prefer-online --no-fund --no-audit --no-update-notifier --loglevel=error $PackageSpec if ($LASTEXITCODE -ne 0) { throw "npm install failed." } $packageDir = Join-Path $prefix "node_modules\$Package" diff --git a/install/install.sh b/install/install.sh index 994ccd6f2..d24fde400 100755 --- a/install/install.sh +++ b/install/install.sh @@ -132,8 +132,9 @@ install_package() { mkdir -p "$INSTALL_DIR/npm" # npm's shebang resolves `node` from PATH, so put the selected Node first. # DevSpace and its dependencies ship prebuilt binaries, so no install scripts are needed. + # --prefer-online revalidates cached metadata, so a rerun right after a release installs that release. PATH="$NODE_BIN_DIR:$PATH" "$NODE_BIN_DIR/npm" install --global --prefix "$INSTALL_DIR/npm" \ - --ignore-scripts --no-fund --no-audit --no-update-notifier --loglevel=error "$PACKAGE_SPEC" + --ignore-scripts --prefer-online --no-fund --no-audit --no-update-notifier --loglevel=error "$PACKAGE_SPEC" } write_launchers() {