From 6a6be8890e3e39c4f574cb69ac7162337c2ec6e7 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Fri, 13 Mar 2026 21:28:25 +0900 Subject: [PATCH 1/4] fix(cli): show errors when vp install fails and bypass pnpm minimumReleaseAge --- packages/cli/install.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/cli/install.sh b/packages/cli/install.sh index df817040e0..1a4ecc92a7 100644 --- a/packages/cli/install.sh +++ b/packages/cli/install.sh @@ -574,10 +574,19 @@ main() { } WRAPPER_EOF + # Isolate from user's global pnpm config (e.g. minimumReleaseAge) + # by creating a local .npmrc in the version directory. + cat > "$VERSION_DIR/.npmrc" <&1); then + error "Failed to install dependencies. Re-run without piping to see full output: + curl -fsSL https://vite.plus -o /tmp/vp-install.sh && bash /tmp/vp-install.sh" + fi fi # Create/update current symlink (use relative path for portability) From 4451eac67db6c5f4c6df16d8c867b96cee8fd071 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Fri, 13 Mar 2026 23:16:00 +0900 Subject: [PATCH 2/4] fix(cli): avoid for windows ref: https://github.com/voidzero-dev/vite-plus/pull/834#issuecomment-4055245395 --- packages/cli/install.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/cli/install.ps1 b/packages/cli/install.ps1 index 22a3e08456..f3120ffb0d 100644 --- a/packages/cli/install.ps1 +++ b/packages/cli/install.ps1 @@ -316,13 +316,21 @@ function Main { } | ConvertTo-Json -Depth 10 Set-Content -Path (Join-Path $VersionDir "package.json") -Value $wrapperJson + # Isolate from user's global pnpm config (e.g. minimumReleaseAge) + # by creating a local .npmrc in the version directory. + Set-Content -Path (Join-Path $VersionDir ".npmrc") -Value "minimum-release-age=0" + # Install production dependencies (skip if VITE_PLUS_SKIP_DEPS_INSTALL is set, # e.g. during local dev where install-global-cli.ts handles deps separately) if (-not $env:VITE_PLUS_SKIP_DEPS_INSTALL) { Push-Location $VersionDir try { $env:CI = "true" - & "$BinDir\vp.exe" install --silent + & "$BinDir\vp.exe" install + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to install dependencies. Please check the error output above." + exit 1 + } } finally { Pop-Location } From 5585f81ea2f898687f38149f1d6bf7fea283ab82 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Fri, 13 Mar 2026 23:20:41 +0900 Subject: [PATCH 3/4] fix(cli): support npm min-release-age case --- packages/cli/install.ps1 | 7 ++++--- packages/cli/install.sh | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/cli/install.ps1 b/packages/cli/install.ps1 index f3120ffb0d..8e17bcb925 100644 --- a/packages/cli/install.ps1 +++ b/packages/cli/install.ps1 @@ -316,9 +316,10 @@ function Main { } | ConvertTo-Json -Depth 10 Set-Content -Path (Join-Path $VersionDir "package.json") -Value $wrapperJson - # Isolate from user's global pnpm config (e.g. minimumReleaseAge) - # by creating a local .npmrc in the version directory. - Set-Content -Path (Join-Path $VersionDir ".npmrc") -Value "minimum-release-age=0" + # Isolate from user's global package manager config that may block + # installing recently-published packages (e.g. pnpm's minimumReleaseAge, + # npm's min-release-age) by creating a local .npmrc in the version directory. + Set-Content -Path (Join-Path $VersionDir ".npmrc") -Value "minimum-release-age=0`nmin-release-age=0" # Install production dependencies (skip if VITE_PLUS_SKIP_DEPS_INSTALL is set, # e.g. during local dev where install-global-cli.ts handles deps separately) diff --git a/packages/cli/install.sh b/packages/cli/install.sh index 1a4ecc92a7..0962639e1d 100644 --- a/packages/cli/install.sh +++ b/packages/cli/install.sh @@ -574,10 +574,12 @@ main() { } WRAPPER_EOF - # Isolate from user's global pnpm config (e.g. minimumReleaseAge) - # by creating a local .npmrc in the version directory. + # Isolate from user's global package manager config that may block + # installing recently-published packages (e.g. pnpm's minimumReleaseAge, + # npm's min-release-age) by creating a local .npmrc in the version directory. cat > "$VERSION_DIR/.npmrc" < Date: Sat, 14 Mar 2026 01:17:56 +0900 Subject: [PATCH 4/4] fix: more improvement --- packages/cli/install.ps1 | 5 +++-- packages/cli/install.sh | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/cli/install.ps1 b/packages/cli/install.ps1 index 8e17bcb925..b1f56462f1 100644 --- a/packages/cli/install.ps1 +++ b/packages/cli/install.ps1 @@ -324,12 +324,13 @@ function Main { # Install production dependencies (skip if VITE_PLUS_SKIP_DEPS_INSTALL is set, # e.g. during local dev where install-global-cli.ts handles deps separately) if (-not $env:VITE_PLUS_SKIP_DEPS_INSTALL) { + $installLog = Join-Path $VersionDir "install.log" Push-Location $VersionDir try { $env:CI = "true" - & "$BinDir\vp.exe" install + & "$BinDir\vp.exe" install --silent *> $installLog if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to install dependencies. Please check the error output above." + Write-Host "error: Failed to install dependencies. See log for details: $installLog" -ForegroundColor Red exit 1 } } finally { diff --git a/packages/cli/install.sh b/packages/cli/install.sh index 13dfed64dc..9c097b5b55 100644 --- a/packages/cli/install.sh +++ b/packages/cli/install.sh @@ -603,9 +603,10 @@ NPMRC_EOF # Install production dependencies (skip if VITE_PLUS_SKIP_DEPS_INSTALL is set, # e.g. during local dev where install-global-cli.ts handles deps separately) if [ -z "${VITE_PLUS_SKIP_DEPS_INSTALL:-}" ]; then - if ! (cd "$VERSION_DIR" && CI=true "$BIN_DIR/vp" install 2>&1); then - error "Failed to install dependencies. Re-run without piping to see full output: - curl -fsSL https://vite.plus -o /tmp/vp-install.sh && bash /tmp/vp-install.sh" + local install_log="$VERSION_DIR/install.log" + if ! (cd "$VERSION_DIR" && CI=true "$BIN_DIR/vp" install --silent > "$install_log" 2>&1); then + error "Failed to install dependencies. See log for details: $install_log" + exit 1 fi fi