shadowspawn/node-version-usage

Consider adding note for `nvm` about how to use `.node-version` in a compatible way with `nvm`

darcyparker opened this issue ยท 7 comments

Although nvm does not officially support .node-version yet
(See nodejs/version-management#13, nodejs/version-management#21), you can use a .node-version with nvm like this:
ln -s .node-version .nvmrc

This works because, .nvmrc supports the .node-version syntax (with an without the v prefix). So .nvmrc is a superset of .node-version.

If one is careful to follow the .node-version specification here, a symbolic link from .node-version to .nvmrc is a good solution until nvm officially supports it.

BTW: volta-cli/volta#983 is considering support of .node-version and referenced this repo.

Thanks for volta link, I am subscribed to that issue now.

My current focus is products which support or use .node-version, and I do not wish to add work-arounds for other node version managers or products. However, this issue does now provide your info for anyone who searches for nvm here in the future.

Related links in nvm-sh:

For interest, same work-around of linking mentioned here: xmldom/xmldom#52 (comment)

That sounds fair about only focusing on products that use .node-version. And you're right, someone can easily find the work-around method here by searching and elsewhere.

Given the popularity of nvm, I'd actually support having a note explicitly indicating its lack of support for .node-version, just to avoid possible confusion due to its absence from this list.

I'll reopen this to give it some more visibility and opportunity for feedback (๐Ÿ‘) , since a few people have already found it since being closed. That might indicate I was correct about people finding the info, or might indicate worth documenting! ๐Ÿ˜„

I have added a note to README that nvm does not support .node-version, with a link to this issue.

I have added a note to README that nvm does not support .node-version, with a link to this issue.

Thanks! For reference, that was done in 714de96.