Skip to content

Adding a Version Checker #44942

Closed
Closed
@flakey5

Description

@flakey5

What is the problem this feature will solve?

Node does not have a version checker that lets the user know if they're on an outdated version. In my opinion, having one would absolutely improve QOL and would help notifying users of new versions.

What is the feature you are proposing to solve the problem?

Adding a opt-in version checker. I propose it as opt-in because of potential privacy concerns and this could be considered a breaking change due to the additional overhead. Also, I believe it would be best to implement it on the Javascript side just for simplicity.

The Node.js website already has a file that is automatically updated with every release (https://nodejs.org/dist/index.json) so all changes that need to be made are in Node core itself.

  • Opt-in via --check-update cli argument and you set it to what release branch you follow.
    • This would work like --version where it simply checks for an update and then exits.
    • --check-update=current - Follows the most current release, User will get notified for any new version.
    • --check-update=lts - Follows the most recent LTS release. It will skip any odd-numbered majors and only focuses on the latest release of a LTS version. Ex/ user running v16.x.x will get notified for v18.x.x but not for v17.x.x since it's not LTS
    • --check-update=same - Follows whatever major you are on and ignores any updates not pertaining to the major. Ex/ user running v17.x.x will get notified for v17.y.y but not for v18.z.z since it's not on the same major. The name for this isn't great, if someone has a better idea please say so. If the cli argument is passed with no value (--check-update and nothing else), this is what it defaults to.
  • --version-check-url cli argument in case the user would like to override the url it requests for whatever reason
  • New updates presented to user via process.emitWarning with a message such as New version available! vX.X.X (current) -> vY.Y.Y (new). Could also add a note if it's a security release like New version available! vX.X.X (current) -> vY.Y.Y (new) (security release).
  • Any potential errors that occur while checking the version fail silently due to the user not being in control of it and therefore can't really do anything about it

I am currently working on implementing this and created this issue to open the discussion on it and get some feedback. I have a basic experimental implementation which is linked in the reply directly below this post.

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.tsc-agendaIssues and PRs to discuss during the meetings of the TSC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions