Skip to content

Commit 4451eac

Browse files
committed
fix(cli): avoid for windows
ref: #834 (comment)
1 parent 6a6be88 commit 4451eac

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/cli/install.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,21 @@ function Main {
316316
} | ConvertTo-Json -Depth 10
317317
Set-Content -Path (Join-Path $VersionDir "package.json") -Value $wrapperJson
318318

319+
# Isolate from user's global pnpm config (e.g. minimumReleaseAge)
320+
# by creating a local .npmrc in the version directory.
321+
Set-Content -Path (Join-Path $VersionDir ".npmrc") -Value "minimum-release-age=0"
322+
319323
# Install production dependencies (skip if VITE_PLUS_SKIP_DEPS_INSTALL is set,
320324
# e.g. during local dev where install-global-cli.ts handles deps separately)
321325
if (-not $env:VITE_PLUS_SKIP_DEPS_INSTALL) {
322326
Push-Location $VersionDir
323327
try {
324328
$env:CI = "true"
325-
& "$BinDir\vp.exe" install --silent
329+
& "$BinDir\vp.exe" install
330+
if ($LASTEXITCODE -ne 0) {
331+
Write-Error "Failed to install dependencies. Please check the error output above."
332+
exit 1
333+
}
326334
} finally {
327335
Pop-Location
328336
}

0 commit comments

Comments
 (0)