Skip to content

fix(cli): show errors when vp install fails and bypass npm & pnpm minimum release age#834

Merged
fengmk2 merged 5 commits intovoidzero-dev:mainfrom
kazupon:fix/833
Mar 14, 2026
Merged

fix(cli): show errors when vp install fails and bypass npm & pnpm minimum release age#834
fengmk2 merged 5 commits intovoidzero-dev:mainfrom
kazupon:fix/833

Conversation

@kazupon
Copy link
Copy Markdown
Collaborator

@kazupon kazupon commented Mar 13, 2026

Summary

resolve #833

  • Remove --silent from vp install in install.sh so that pnpm/npm errors are visible to the user instead of being silently swallowed
  • Add a local .npmrc with minimum-release-age=0 to the version directory to isolate the installer from the user's global pnpm configuration (e.g. minimumReleaseAge blocking recently-published packages)

Previously, when vp install --silent failed (for any reason), set -e would abort install.sh with no error output, leaving ~/.vite-plus/ in a partial state: no node_modules, no bin/ symlink, no env file, and no PATH configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit 403fac0
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69b4e45b9a840fd5fa3db7a0
😎 Deploy Preview https://deploy-preview-834--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Brooooooklyn Brooooooklyn requested a review from fengmk2 March 13, 2026 12:47
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Mar 13, 2026

@kazupon Can install.ps1 be considered for a fix as well? I understand that there will be a similar issue under Windows?

@fengmk2 fengmk2 added the bug Something isn't working label Mar 13, 2026
@kazupon
Copy link
Copy Markdown
Collaborator Author

kazupon commented Mar 13, 2026

@fengmk2
I've just fixed for windows at this commit

And npm too.

@kazupon kazupon changed the title fix(cli): show errors when vp install fails and bypass pnpm minimumReleaseAge fix(cli): show errors when vp install fails and bypass npm & pnpm minimum release age Mar 13, 2026
@Brooooooklyn Brooooooklyn requested a review from Copilot March 13, 2026 14:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the Vite+ installer UX by preventing silent dependency-install failures and by isolating installs from user/global package-manager settings that can block newly published packages.

Changes:

  • Create a per-version .npmrc to bypass minimum release age constraints (minimum-release-age=0 / min-release-age=0).
  • Stop using --silent for vp install so npm/pnpm errors are visible.
  • Add explicit failure handling for dependency installation (bash: custom error message; PowerShell: $LASTEXITCODE check).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/cli/install.sh Writes a local .npmrc and makes dependency-install failures visible/handled.
packages/cli/install.ps1 Writes a local .npmrc and removes silent install, adding explicit exit-code handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kazupon
Copy link
Copy Markdown
Collaborator Author

kazupon commented Mar 13, 2026

Thanks for the review!
I've just updated :)

Copy link
Copy Markdown
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Thanks helping us to improve this install DX!

@fengmk2 fengmk2 merged commit 543a054 into voidzero-dev:main Mar 14, 2026
28 checks passed
fengmk2 pushed a commit that referenced this pull request Apr 8, 2026
## Summary

related issues and PRs
- #1260 
- #1272 
- #833 
- #834 

This updates the release-age handling for the Vite+ global
install/upgrade path so we no longer silently bypass package manager
protections.

Users who configure pnpm `minimumReleaseAge` are explicitly trying to
reduce supply-chain risk from newly published compromised packages.

Instead of always writing `minimum-release-age=0`, Vite+ now first runs
the wrapper install normally.

If pnpm blocks the install with a release-age error, Vite+ only writes
the local override and retries after an interactive, default-No
confirmation.

The same behavior is applied to the standalone install scripts,
including `install.ps1` and `install.sh`.

## Changes

- Remove unconditional `minimum-release-age=0` override from `vp
upgrade` and standalone installers.
- Detect pnpm release-age failures from
`ERR_PNPM_NO_MATURE_MATCHING_VERSION`, `minimumReleaseAge` messages, and
guarded `ERR_PNPM_NO_MATCHING_VERSION` cases.
- Prompt users with a default-No warning before disabling release-age
protection for this Vite+ install only.
- Keep non-interactive environments blocked instead of adding a bypass
flag or env var.
- Preserve `install.log` / `upgrade.log` visibility for failure
diagnosis.
- Avoid passing `--silent` to the inner captured `vp install`, because
pnpm suppresses the release-age error body in silent mode.
- Add comments with pnpm source references explaining the release-age
detection signals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

curl -fsSL https://vite.plus | bash fails silently when vp install encounters an error

3 participants