Skip to content

JS based tools in vp stop working after setting an incompatible node version with vp env #1358

@liangmiQwQ

Description

@liangmiQwQ

Describe the bug

According to js_executor.rs, almost all JS based vp commands will use project_runtime set by vp env

So, if users set an incompatible node version out of the scope of "^20.19.0 || >=22.12.0" which set in "vite-plus"'s package.json, some vp commands will be unusable because of missing utils, unknown extensions or other issues.


I think this is not completely a bug but a design discussion. And I don't know whether is just an expected behavior.

Only vp has the problem because other node version managers do not have JS part so there are no responsibility for them to make sure other js tools run correctly.

But vp has its own node part and integrated some js tools, so it became hard to decide whether we should ensure other vp tools to run no matter node version is set.

I've tried making fixes for it, I previously thought perhaps a feasible solution is to switch a compatible node versions for vp commands, but I found it really complex as there are commands like vp test, vp run which runs users' code in codebase, and vp install which should not only care vp's node version scope but also respect package manger's. So maybe more discussions are needed on this topic.

Thanks.

Reproduction

https://github.com/liang-demos/vp-node-version

Steps to reproduce

https://github.com/liang-demos/vp-node-version#readme

Validations

Metadata

Metadata

Assignees

Type

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions