Skip to content

Support .nvmrc as a source for node version #2207

Description

@BlankParticle

Description

I love using vite-plus for managing my node version
but it only supports node version from .node-version or package.json fields
there are a lot of projects which uses .nvmrc files for node version, either with nvm or a compatible tool that respects .nvmrc

Vite+ should also respect .nvmrc as a source for node version when the other 2 sources are not there. vp migrate already parses .nvmrc and migrates to the supported config sources, but when I am working on a one of fix/feature on a repo I just want vp to resolve the correct node version as changing unrelated files to node version is not something we should be worrying about.

Suggested solution

Add suport for .nvmrc here

.node-version file (current or parent directories)
devEngines.runtime in package.json (the [devEngines standard](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines))
engines.node in package.json
+ .nvmrc file
The global default (vp env default), then the latest LTS

Alternative

run vp env use everytime in the repo or add a supported config file in a different PR if the maintainer allows it

Additional context

https://discord.com/channels/1475973262193459293/1479410337223802951/1528691105695137916
https://discord.com/channels/1475973262193459293/1479410337223802951/1528706682148884573

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

Fields

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