Skip to content

Commit b166648

Browse files
committed
fix: remove stale lockfile before vp install in install scripts
When reinstalling, a stale pnpm-lock.yaml from a previous install remains in the version directory. With CI=true, pnpm uses --frozen-lockfile which rejects the mismatch between the old lockfile and the new package.json, causing bootstrap-cli to fail.
1 parent 753869d commit b166648

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

packages/global/install.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ function Main {
406406
$pkg.PSObject.Properties.Remove("optionalDependencies")
407407
$pkg | ConvertTo-Json -Depth 10 | Set-Content $pkgFile
408408

409+
# Remove stale lockfile and node_modules to avoid frozen-lockfile conflicts
410+
# when package.json changes between installs
411+
Remove-Item -Path "$VersionDir\pnpm-lock.yaml" -Force -ErrorAction SilentlyContinue
412+
Remove-Item -Path "$VersionDir\node_modules" -Recurse -Force -ErrorAction SilentlyContinue
413+
409414
# Install production dependencies
410415
Push-Location $VersionDir
411416
try {

packages/global/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,11 @@ main() {
640640
{ print }
641641
' "$pkg_file" > "$pkg_file.tmp" && mv "$pkg_file.tmp" "$pkg_file"
642642

643+
# Remove stale lockfile and node_modules to avoid frozen-lockfile conflicts
644+
# when package.json changes between installs
645+
rm -f "$VERSION_DIR/pnpm-lock.yaml"
646+
rm -rf "$VERSION_DIR/node_modules"
647+
643648
# Install production dependencies
644649
(cd "$VERSION_DIR" && CI=true "$BIN_DIR/vp" install --silent)
645650

0 commit comments

Comments
 (0)