Skip to content

Commit 5585f81

Browse files
committed
fix(cli): support npm min-release-age case
1 parent 4451eac commit 5585f81

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

packages/cli/install.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,10 @@ 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"
319+
# Isolate from user's global package manager config that may block
320+
# installing recently-published packages (e.g. pnpm's minimumReleaseAge,
321+
# npm's min-release-age) by creating a local .npmrc in the version directory.
322+
Set-Content -Path (Join-Path $VersionDir ".npmrc") -Value "minimum-release-age=0`nmin-release-age=0"
322323

323324
# Install production dependencies (skip if VITE_PLUS_SKIP_DEPS_INSTALL is set,
324325
# e.g. during local dev where install-global-cli.ts handles deps separately)

packages/cli/install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,12 @@ main() {
574574
}
575575
WRAPPER_EOF
576576

577-
# Isolate from user's global pnpm config (e.g. minimumReleaseAge)
578-
# by creating a local .npmrc in the version directory.
577+
# Isolate from user's global package manager config that may block
578+
# installing recently-published packages (e.g. pnpm's minimumReleaseAge,
579+
# npm's min-release-age) by creating a local .npmrc in the version directory.
579580
cat > "$VERSION_DIR/.npmrc" <<NPMRC_EOF
580581
minimum-release-age=0
582+
min-release-age=0
581583
NPMRC_EOF
582584

583585
# Install production dependencies (skip if VITE_PLUS_SKIP_DEPS_INSTALL is set,

0 commit comments

Comments
 (0)