Skip to content

Give vp env a separate name #1152

@lisiur

Description

@lisiur

Description

Our project members use different Node managers, so we wrote a script to detect whether the current user has fnm, nvm, or vp installed. If found, the script uses that manager to switch Node versions.
However, we've run into an issue: the vp env command only exists in the globally installed version of vp. The version located in node_modules/.bin/vp does not have the env subcommand.
Since our version-switching script is executed via package.json scripts, running npm run switch-node causes the local node_modules/.bin/vp to take precedence over the global one, which leads to a "error: Command 'env' not found" error.

Suggested solution

Provide a dedicated vpenv command (instead of just vp env) upon global installation. This would prevent the vp binary in node_modules/.bin from shadowing the global command and breaking the environment switching functionality.

Alternative

No response

Additional context

No response

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