Skip to content

Force to use a compatible version for vp upgrade #1876

Description

@liangmiQwQ

Describe the bug

Reference #1865 (comment)

vp upgrade now uses the node version resolved from session env var, project configure, which may be not compatible with Vite+'s requirement in package.json#engines.node. That will cause pnpm skip installing the optional binary files that makes Vite+ broken.

We should always use a compatible node version for vp upgrade, just like delegate_to_global_cli. Maybe we can reuse ensure_cli_runtime function but it also needs changing (Embed requirement at buildtime instead of reading at runtime, similar to #1412

Reproduction

This can be reproduced by following the steps given in the vite-plus's source code repo.

Steps to reproduce

  1. Cd into the current vite-plus repo
  2. Run pnpm boostrap-cli && vp env use 20.0.0
  3. Run vp upgrade
  4. Run vp commands like vp pack, vp build

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions