You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adopt Semantic Versioning 2.0.0: returning X.Y.Z instead of vX.Y.Z for node -v #40964
changed the title [-]Adopt Semantic Versioning 2.0.0: return `17.1.0` for `node -v`[/-][+]Adopt Semantic Versioning 2.0.0: returning `X.Y.Z` instead of `vX.Y.Z` for `node -v`[/+]on Nov 25, 2021
This seems like a change that is guaranteed to break a lot of code for little or no upside.
No one should update a major version without checking release notes, especially the section "Breaking changes". So, if such change would not be digged somewhere in a list of commits, then there should not be a problem.
For instance, the 17.1.0 release introduced an asert for importing JSON modules, which broke the native importing of JSONs, although assert is not at the stage 4 of TC39 and therefore is not supported by ESLint:
That was even not a major release, just a minor one but still broke a code, which used to work for several years (yes, I know it's under the flag, but still).
> Stability: 1 - Experimental. The feature is not subject to
> [Semantic Versioning][] rules. Non-backward compatible changes or removal may
> occur in any future release. Use of the feature is not recommended in
> production environments.
That's why importing a JSON module comes with a ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time warning. FYI you can still use assertionless JSON imports if you are willing to use an extra flag, see #40758 (comment).
No one should update a major version without checking release notes
Reading the release notes would not help you in case you are relying on an old version of a package or software that do expect to see a v at the start of the output of node -v. Sure you can say it's on them, and they should either upgrade the other software, or keep using the old Node.js version, but to me that sounds like making the life of some of our users harder for the sake of correctness.
Activity
[-]Adopt Semantic Versioning 2.0.0: return `17.1.0` for `node -v`[/-][+]Adopt Semantic Versioning 2.0.0: returning `X.Y.Z` instead of `vX.Y.Z` for `node -v`[/+]Trott commentedon Nov 25, 2021
In case it helps with your use case, if you want the version without a
v, you can useprocess.versions.node.True if you maintain libraries used by a few thousand people. Not even close to true for Node.js.
This seems like a change that is guaranteed to break a lot of code for little or no upside.
pubmikeb commentedon Nov 25, 2021
No one should update a major version without checking release notes, especially the section "Breaking changes". So, if such change would not be digged somewhere in a list of commits, then there should not be a problem.
For instance, the
17.1.0release introduced anasertfor importing JSON modules, which broke the native importing of JSONs, althoughassertis not at the stage 4 of TC39 and therefore is not supported by ESLint:That was even not a major release, just a minor one but still broke a code, which used to work for several years (yes, I know it's under the flag, but still).
aduh95 commentedon Nov 25, 2021
Anything experimental is explicitly opted-out from semver:
node/doc/api/documentation.md
Lines 31 to 34 in d0b58c0
That's why importing a JSON module comes with a
ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any timewarning. FYI you can still use assertionless JSON imports if you are willing to use an extra flag, see #40758 (comment).Reading the release notes would not help you in case you are relying on an old version of a package or software that do expect to see a
vat the start of the output ofnode -v. Sure you can say it's on them, and they should either upgrade the other software, or keep using the old Node.js version, but to me that sounds like making the life of some of our users harder for the sake of correctness.targos commentedon Nov 25, 2021
FWIW, I checked the output of
--versionfor other software (git, deno, zsh, gh) and none of them output a semver-compatible string.pubmikeb commentedon Nov 25, 2021
I've just checked a value for
git --versionand got:Well, if other significant projects aren't semver-compatible as well, then OK, although, it's always good to be a widely accepted standard compatible.
Trott commentedon Nov 26, 2021
Thanks for opening the issue. I'm going to close this. If any collaborators think we should reconsider, please comment or reopen.