Add support for Node 23
If --engine-strict is used, npm install fails with:
npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: [email protected]
npm error notsup Not compatible with your version of node/npm: [email protected]
npm error notsup Required: {"node":"^18.18.0 || ^20.9.0 || ^22.0.0"}
npm error notsup Actual: {"npm":"10.9.0","node":"v23.1.0"}
If --engine-strict is not used, a warning is printed instead, but npm install does not fail.
We haven't tested it on Node.js v23 yet, feel free to do so.
For the record, it looks like this change from supporting all future Node versions to only the specified Node versions occurred here: https://github.com/release-it/release-it/commit/24b3ba66a7a182d1d2086903aacff2300170ba6b
What do you think is the best practice here?
Personally, I find it more convenient to include all future Node versions in the engines range, like eslint does for example:
https://github.com/eslint/eslint/blob/ee8c2200a19dd55aa5068b6cd336a2aec7c52ad3/package.json#L217
That makes it easier for consumers to install / run / test the package under all the latest / supported Node versions, without depending on every package to release an update to expand the range every six months.
Agreed, Node.js is stable enough. Feel free to open a PR for this.
Personally, I find it more convenient to include all future Node versions in the engines range, like eslint does for example:
https://github.com/eslint/eslint/blob/ee8c2200a19dd55aa5068b6cd336a2aec7c52ad3/package.json#L217
That makes it easier for consumers to install / run / test the package under all the latest / supported Node versions, without depending on every package to release an update to expand the range every six months.
just opened a PR with this exact implementation
Node 23 is already EOL and the engines field is now set to >=22.x anyway. This can be closed.