Uh oh!
There was an error while loading. Please reload this page.
feat: .node-version support - #2007
Conversation
andreassjoberg
commented
Mar 5, 2025
Hi @rwjblue! I opened this PR in accordance with our discussions in the RFC. |
rwjblue
left a comment
There was a problem hiding this comment.
Implementation seems generally correct, I think we are missing (from the RFC) a few things:
- implementation for error messages mentioned in RFC
- tests
- package.json with volta + .node-version (uses package.json)
- no volta in package.json + .node-version (uses .node-version)
- no volta in package.json + no .node-version (uses global default)
- no volta in package.json + .node-version with invalid semver (e.g.
lts/*) (should error with nice message) - no volta in package.json + .node-version with extra unexpected content (should error with nice message)
andreassjoberg
commented
Mar 5, 2025
@rwjblue I added some test cases and better error handling. I did not differentiate between:
since that would involve parsing the contents of the file further, even after error. Plus; how do we determine invalid semver compared to just a malformed string? Quite hard logic to specify I believe. 🙃 |
rwjblue
commented
Mar 5, 2025
Ya good point, I totally agree with you. I think that there might be something useful RE: specifying a valid looking value that just isn't a valid Node version (e.g. Right now (with I think that's probably still fine, but I think we need to update the output to indicate why we were looking for that version. In today's world it always comes from the same place ( Probably best to update the RFC with some of this info too. |
andreassjoberg
commented
Mar 6, 2025
Thanks for the input @rwjblue. This last bit about printing the source of the node version appears a bit more complex, and unfortunately, I don't have the time to implement this right now. I still think the implementation is solid though. |
rwjblue
commented
Mar 7, 2025
Sure, seems good to me. |
rwjblue
commented
Mar 7, 2025
One thing I'm not sure of, is if we should feature flag this (defaulting to on). I'm not really sure what our normal process there is. The actual implementation seems like something fairly easy to back out if we needed to (e.g. it isn't spanning a ton of different files and whatnot), so I'm not sure that we really need a feature flag? Maybe @charlespierce or @chriskrycho have opinions? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
andreassjoberg
commented
Mar 13, 2025
@rwjblue - What's the status of this? |
rwjblue
commented
Mar 16, 2025
I need to check with @charlespierce and @chriskrycho RE: the RFC, but I think it's probably pretty close (if not good to go). |
StormPooper
commented
Apr 13, 2025
shadowspawn/node-version-usage outlines some scenarios that might be worth covering for compatibility with other tools:
|
jish
commented
Jul 18, 2025
I'll add a 👍 to the thread as well, but I'm adding a comment because it looks like there hasn't been much movement on this in a few months. Are there still outstanding issues for adding |
huangmingfu
commented
Dec 9, 2025
When can the merge be done? I support it very much, too |
lachieh
commented
Dec 16, 2025
Volta is unmaintained. It is doubtful that this will be merged. See #2080. |
GuillaumeNury
commented
Jan 14, 2026
This feature would greatly improve Volta -> Mise migration as Mise supports |
Support for
.node-versionfile in accordance with volta-cli/rfcs#54.Extended on #1974:
.node_version->.node-versionvand ignoring line endings