-
Notifications
You must be signed in to change notification settings - Fork 58
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
BREAKING CHANGE(engines): engines support for npm 9.0.0
#519
Comments
Alternatively, we can set node 18 support as Roadblocks to this are code that @wraithgar added that makes npm refuse to install itself globally if engines doesn't match. We could special case odd node versions and document/log our support for them, which would basically be "it should work, but is not officially supported" |
In hindsight the support levels being set at "when it went lts" were kind of arbitrary, and absent any features in 14 we want to start using, I don't think it warrants pinning anything higher. Functionally, only the lowest semver major in the matrix really defines the bounds because nodejs doesn't typically introduce the same feature in multiple semver major versions. esm would have been a good thing for us to identify in Going forward I think that unless there are features in the lowest semver major that we think we want to start using in the next year, leaving it as As far as odd numbered nodejs versions, I think that the current engines check warning can be tweaked to say something slightly different if it detects your nodejs version is an odd number. It can explain that npm will probably work but remind folks that odd numbered nodejs is not stable, etc. |
some features that we may want to use and the minimum node versions to support them: private class methods (i.e. no more symbols): ^14.19.3 |
I can see us using private class methods once available. that will clean up a LOT of hard to read code, which is very important to me. |
After a bit of discussion we have identified a root problem here being that we are conflating support and compatibility. Engines denotes compatibility. This is distinct from a "support" contract. We need to come up with our "support" contract that explains things like our intention to align w/ the support roadmap of nodejs versions. Once we've done that our engines field can become something much simpler like |
we discussed this a little further and because it might be important to keep engines support wide for ecosystem compatability i wrote this and found const privateMethod = () => {
class C {
#x() { return 42; }
x() {
return this.#x();
}
}
return new C().x() === 42;
}
const optionalChaining = () => {
const x = {}
return x?.y?.z === undefined
}
const nullishCoalescing = () => {
return (null ?? 42) === 42
}
console.log(
privateMethod(),
optionalChaining(),
nullishCoalescing()
) ❯ node --version && node index.js
v14.5.0
/Users/lukekarrys/Documents/npm-issues/statusboard-519/index.js:3
#x() { return 42; }
^
SyntaxError: Unexpected token '(' ❯ node --version && node index.js
v14.6.0
true true true |
This might be a useful starting place: https://github.com/nodejs/package-maintenance/blob/main/docs/PACKAGE-SUPPORT.md I think there are issues and genuine concerns which folks have brought up in the past, including @darcyclarke. But, if you are looking to try and separate out the "compatible" and "supported" this was our attempt to decouple them while also giving it structure. EDIT: also here is what I think was the last conversation related to that: nodejs/package-maintenance#192 |
We use readable-stream in the cli (only via npmlog which will be dropped sometime in the future, but maybe not before npm9?) and the recent major version uses |
9.0.0
BREAKING CHANGE: `npm` is now compatible with the following semver range for node: `^14.17.0 || ^16.0.0 || >=18.0.0` Ref: npm/statusboard#519
BREAKING CHANGE: `npm` is now compatible with the following semver range for node: `^14.17.0 || ^16.0.0 || >=18.0.0` Ref: npm/statusboard#519
This also replaces the previous check for known broken versions of node with an exception handler for syntax errors in order to try and give a nicer error message when attempting to run npm on older node versions. BREAKING CHANGE: `npm` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0` Ref: npm/statusboard#519
This also replaces the previous check for known broken versions of node with an exception handler for syntax errors in order to try and give a nicer error message when attempting to run npm on older node versions. BREAKING CHANGE: `npm` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0` Ref: npm/statusboard#519
This also replaces the previous check for known broken versions of node with an exception handler for syntax errors in order to try and give a nicer error message when attempting to run npm on older node versions. BREAKING CHANGE: `npm` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0` Ref: npm/statusboard#519
@lukekarrys can this be closed? |
Update supported node versions to match npm/cli v9: `^14.17.0 || ^16.0.0 || >=18.0.0` References - [BREAKING CHANGE(engines): engines support for npm 9.0.0](npm/statusboard#519) - [Related npm/cli change](npm/cli@457d388) Signed-off-by: Philip Harrison <[email protected]>
Update supported node versions to match npm/cli v9: `^14.17.0 || ^16.0.0 || >=18.0.0` References - [BREAKING CHANGE(engines): engines support for npm 9.0.0](npm/statusboard#519) - [Related npm/cli change](npm/cli@457d388) Signed-off-by: Philip Harrison <[email protected]>
Summary
We want to ensure that the CLI's
engines
field is as up-to-date as possible & reflects a realistic set ofnode
versions that it will work on & that our team cares to "support".Details
engines
spec:^12.22.0 || ^14.17.0 || >=16.0.0
15
&17
won't be supported byv9
(this is becausenode
does not support them anymore - ref. https://nodejs.org/en/about/releases/)node
versionsExit Criteria
cli
template-oss
knownBroken
innpm/cli
(ref../lib/cli.js
)Notes & References
Proposed major version support for npm 9.
12
^12.13.0
14
^14.15.0
^14.15.0
16
:>=16
^16.13.0
16.13.0
. This made sense for us but caused problems if other parts of the ecosystem settled on a different minor/patch version for LTS. For example,npm@8
used^12.13.0
andnode-gyp@9
used^12.22.0
which made upgrading difficult. We should collaborate with other packages to see what version of node 16 we should support.18
:>=16
>=18
^17
and^19
supported via>=16
>=16
to>=18
) is a breaking change in our current support contract. The proposed solution above would be documented in aSUPPORT.md
file in all relevant repos.The text was updated successfully, but these errors were encountered: