Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
darcyparker opened this issue May 3, 2021 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@darcyparker
Copy link

darcyparker commented May 3, 2021

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.

@shadowspawn
Copy link
Owner

shadowspawn commented May 4, 2021

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:

@shadowspawn
Copy link
Owner

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

@darcyparker
Copy link
Author

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.

kanadgupta added a commit to Twin-Cities-Mutual-Aid/twin-cities-aid-distribution-locations that referenced this issue May 10, 2021
It looks like we're running tests off Node 16 in Travis, and it supports .nvmrc but not .node-version? https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions-using-nvmrc

I don't want us to maintain two files with our node versions and I saw this issue which described a way to link the two: shadowspawn/node-version-usage#4

I tried that in this commit—let's see if Travis CI likes it!
kanadgupta added a commit to Twin-Cities-Mutual-Aid/twin-cities-aid-distribution-locations that referenced this issue May 10, 2021
* chore: bump node-version

* deps: install ESLint, add .eslintrc

* chore: fix problems in files

* Create .nvmrc

It looks like we're running tests off Node 16 in Travis, and it supports .nvmrc but not .node-version? https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#specifying-nodejs-versions-using-nvmrc

I don't want us to maintain two files with our node versions and I saw this issue which described a way to link the two: shadowspawn/node-version-usage#4

I tried that in this commit—let's see if Travis CI likes it!

* chore: rename .node-version to .nvmrc

Will this work? Ugh

* fix: oh wait try this

We have "stable" specified in our travis.yml which is obviously incorrect and was causing the issue! So let's try this again

* ci: get rid of install step

According to the build log [here](https://travis-ci.com/github/Twin-Cities-Mutual-Aid/twin-cities-aid-distribution-locations/builds/225513649), we're installing our deps twice! Why?

* ci: add lint step before script

* chore: add lint violation to confirm that it fails

* revert: bring back properly linted code
@waldyrious
Copy link

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.

@shadowspawn
Copy link
Owner

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! 😄

@shadowspawn shadowspawn reopened this May 14, 2021
@shadowspawn shadowspawn added the documentation Improvements or additions to documentation label May 14, 2021
@shadowspawn
Copy link
Owner

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

@waldyrious
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants