volta icon indicating copy to clipboard operation
volta copied to clipboard

Support `.node-version` file as a source of truth for Node

Open charlespierce opened this issue 3 years ago • 5 comments

Related to #959 Related to #282

As noted in this comment, .node-version is intended to specify a single, exact version, which is exactly what Volta requires for it's own guarantees. Since there are many different node managers that support (to some level) the .node-version file, we should investigate supporting it as well.

From that comment, the (emerging) spec for .node-version is contained in https://github.com/shadowspawn/node-version-usage

charlespierce avatar May 03 '21 17:05 charlespierce

As someone who doesn't use Volta but is on a project where people are using it, I would find this tremendously useful. Both nvm and asdf (with the nodejs plugin) support .node-version, thus making Volta compatible with it would allow us to easily specify the node version for all our tools.

Ravenstine avatar May 03 '21 20:05 Ravenstine

@Ravenstine nvm absolutely does not support .node-version, quite intentionally.

ljharb avatar May 03 '21 21:05 ljharb

@ljharb Oh, my bad, I must have been thinking of something else. The mention of asdf still applies, though.

Ravenstine avatar May 04 '21 04:05 Ravenstine

fnm does support .node-version too

Lambdaphile avatar May 17 '22 07:05 Lambdaphile

here is an aggregated list of who uses .node-version: https://stackoverflow.com/a/62978089/5648644

jef avatar Jun 29 '22 18:06 jef

@Ravenstine nvm absolutely does not support .node-version, quite intentionally.

You can make nvm support .node-version in a project by making .nvmrc a symlink to .node-version.

RichardCPoint avatar Mar 22 '23 20:03 RichardCPoint