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
- Cd into the current
vite-plus repo
- Run
pnpm boostrap-cli && vp env use 20.0.0
- Run
vp upgrade
- Run vp commands like
vp pack, vp build
Describe the bug
Reference #1865 (comment)
vp upgradenow uses the node version resolved from session env var, project configure, which may be not compatible with Vite+'s requirement inpackage.json#engines.node. That will causepnpmskip installing the optional binary files that makes Vite+ broken.We should always use a compatible node version for
vp upgrade, just likedelegate_to_global_cli. Maybe we can reuseensure_cli_runtimefunction but it also needs changing (Embed requirement at buildtime instead of reading at runtime, similar to #1412Reproduction
This can be reproduced by following the steps given in the vite-plus's source code repo.
Steps to reproduce
vite-plusrepopnpm boostrap-cli && vp env use 20.0.0vp upgradevp pack,vp build