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() {