Consider adding note for `nvm` about how to use `.node-version` in a compatible way with `nvm`
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: https://github.com/volta-cli/volta/issues/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:
- https://github.com/nvm-sh/nvm/issues/794 (opened 2015)
- https://github.com/nvm-sh/nvm/issues/2292
- https://github.com/nvm-sh/nvm/pull/1625
For interest, same work-around of linking mentioned here: https://github.com/xmldom/xmldom/pull/52#issuecomment-651976549
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 714de96d089bdbfa48a7e95c74d2bdf27aeb2358.