Skip to content

Do not resolve project-level Node.js version for global pm commands #1621

@liangmiQwQ

Description

@liangmiQwQ

Description

For now, vp add -g, vp install -g, vp update -g use the node version returned by resolve_version. which will care about project level's node version like .node-version file and even package.json#engines.node.

Semantically speaking, would it make more sense to always use global node version (set with vp env default)?

Suggested solution

Skip project-level's node version, the resolve order is like:

  1. VP_NODE_VERSION env var (session override from vp env use) and .session-node-version file (session override written by vp env use for shell-wrapper-less environments) ⬅️ Should we keep this layer? I prefer ignore them actually.
  2. User default from config.json
  3. Latest LTS version

Alternative

N / A

Additional context

I'm willing to help with it, it may be partially related to #1598

Validations

  • Read the Contributing Guidelines.
  • Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
  • Check that there isn't already an issue requesting the same feature.

Metadata

Metadata

Assignees

No one assigned

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions