GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: .node-version support by andreassjoberg · Pull Request #2007 · volta-cli/volta

Conversation

@andreassjoberg

@andreassjoberg andreassjoberg commented Mar 5, 2025

Copy link
Copy Markdown

Support for .node-version file in accordance with volta-cli/rfcs#54.

Extended on #1974:

  • Fixed naming .node_version -> .node-version
  • Support for optional leading v and ignoring line endings

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

easymikey, nassimbenkirane, jish, Woife5, and adamalix reacted with thumbs up emoji
All reactions
  • 👍 5 reactions
@andreassjoberg
feat: .node-version support
28ad672
@andreassjoberg

andreassjoberg commented Mar 5, 2025

Copy link
Copy Markdown
Author

Hi @rwjblue!

I opened this PR in accordance with our discussions in the RFC.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andreassjoberg andreassjoberg mentioned this pull request Mar 5, 2025
Draft: add .node_version fallback #1974
Closed
rwjblue
rwjblue requested changes Mar 5, 2025
View reviewed changes

@rwjblue rwjblue left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andreassjoberg
fix: Tests and error handling
8d3182f
@andreassjoberg
andreassjoberg requested a review from rwjblue March 5, 2025 20:02
@andreassjoberg

andreassjoberg commented Mar 5, 2025

Copy link
Copy Markdown
Author

@rwjblue I added some test cases and better error handling.

I did not differentiate between:

  • 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)

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. 🙃

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rwjblue

rwjblue commented Mar 5, 2025

Copy link
Copy Markdown
Contributor

how do we determine invalid semver compared to just a malformed string? Quite hard logic to specify I believe

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. .node-version with 99999.99999.9999 -- which doesn't exist).

Right now (with volta.node in package.json) we have the following error:

❯ node -v
Volta error: Could not download [email protected]
from https://nodejs.org/dist/v999.9999.999/node-v999.9999.999-darwin-arm64.tar.gz

Please verify your internet connection and ensure the correct version is specified.

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 (package.json), but we are introducing a new way to have specified the version so we should probably make sure the user knows where the version came from.

Probably best to update the RFC with some of this info too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

andreassjoberg added 2 commits March 6, 2025 08:08
@andreassjoberg
fix: Fix linting problems
441fa97
@andreassjoberg
fix: Minor comment changes
25e7c59
@andreassjoberg

andreassjoberg commented Mar 6, 2025

Copy link
Copy Markdown
Author

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.
My recommendation is that we merge this feature and create an issue for improving the error message you mention above.
Sounds good?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andreassjoberg andreassjoberg mentioned this pull request Mar 6, 2025
feat: add support node_version file #1973
Closed
@rwjblue

rwjblue commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

My recommendation is that we merge this feature and create an issue for improving the error message you mention above.

Sure, seems good to me.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rwjblue

rwjblue commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@E5624

This comment was marked as off-topic.

Sign in to view
@E5624

This comment was marked as off-topic.

Sign in to view
@andreassjoberg

andreassjoberg commented Mar 13, 2025

Copy link
Copy Markdown
Author

@rwjblue - What's the status of this?
Is there anything I can do to progress this into a new release?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rwjblue

rwjblue commented Mar 16, 2025

Copy link
Copy Markdown
Contributor

I need to check with @charlespierce and @chriskrycho RE: the RFC, but I think it's probably pretty close (if not good to go).

nassimbenkirane reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StormPooper

StormPooper commented Apr 13, 2025

Copy link
Copy Markdown

shadowspawn/node-version-usage outlines some scenarios that might be worth covering for compatibility with other tools:

  • simple: three part numeric version, like 20.5.0
  • leading v: numeric version with a leading v, like v20.5.0
  • partial: numeric version with less than three parts, like 20.5
  • EOL: end of line characters used in file, Unix \n or Windows \r\n or none
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jish

jish commented Jul 18, 2025

Copy link
Copy Markdown

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 .node-version file support?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@huangmingfu

huangmingfu commented Dec 9, 2025

Copy link
Copy Markdown

When can the merge be done? I support it very much, too

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

E5624
E5624 approved these changes Dec 9, 2025
View reviewed changes
@lachieh

lachieh commented Dec 16, 2025

Copy link
Copy Markdown

Volta is unmaintained. It is doubtful that this will be merged. See #2080.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GuillaumeNury

GuillaumeNury commented Jan 14, 2026

Copy link
Copy Markdown

This feature would greatly improve Volta -> Mise migration as Mise supports .node-version file (see Idiomatic version files)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@GuillaumeNury GuillaumeNury mentioned this pull request Jan 14, 2026
Volta is unmaintained; we recommend migrating to mise #2080
Open
@chawyehsu chawyehsu mentioned this pull request Nov 17, 2026
feat(project): add .node-version file support for Node resolution chawyehsu/volta#112
Draft

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rwjblue rwjblue Awaiting requested review from rwjblue
1 more reviewer
@E5624 E5624 E5624 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@andreassjoberg @rwjblue @E5624 @StormPooper @jish @huangmingfu @lachieh @GuillaumeNury
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.