Node.js engine version in package.json is not up-to-date
iiroj opened this issue ยท 6 comments
The release logs for Execa 9.0.0 state the following Node.js version support:
Dropped support for Node.js version <18.19.0 and 20.0.0 - 20.4.0. (834e372)
But in the current package.json
it only requires:
Lines 19 to 21 in b959030
Is this intentional, or could the engine version be updated to:
{
"engines": {
"node": "^18.19 || >20.4.0"
}
}
This range should only match the following Node.js versions:
18.19.0, 18.19.1, 18.20.0, 18.20.1, 18.20.2, 18.20.3, 20.10.0, 20.11.0, 20.11.1, 20.12.0, 20.12.1, 20.12.2, 20.13.0, 20.13.1, 20.5.0, 20.5.1, 20.6.0, 20.6.1, 20.7.0, 20.8.0, 20.8.1, 20.9.0, 21.0.0, 21.1.0, 21.2.0, 21.3.0, 21.4.0, 21.5.0, 21.6.0, 21.6.1, 21.6.2, 21.7.0, 21.7.1, 21.7.2, 21.7.3, 22.0.0, 22.1.0, 22.2.0
I can contribute a Pull Request for this if you think it would be a good change. The reason I'm interested in this that I'm trying to follow the minimum supported Node.js version in lint-staged and usually it's up to the direct dependencies like execa
. I have this simple script in the repo which prints out the all the engine versions, but it feels like execa
is not correct at the moment: https://github.com/lint-staged/lint-staged/blob/master/scripts/list-dependency-node-versions.js
Hi @iiroj,
Thanks for opening this issue.
This sounds good to me. @sindresorhus What do you think?
If you want to avoid Node.js 19 entirely, I guess something like this might work: ^18.19 <19 || >20.4.0
The ^
symbol only includes versions within the same major version, so ^18.19 || >20.4.0
and ^18.19 <19 || >20.4.0
are equivalent.
import {satisfies} from 'semver'
console.log(satisfies('18.18.0', '^18.19 <19 || >20.4.0')); // false
console.log(satisfies('18.18.0', '^18.19 || >20.4.0')); // false
console.log(satisfies('18.19.0', '^18.19 <19 || >20.4.0')); // true
console.log(satisfies('18.19.0', '^18.19 || >20.4.0')); // true
console.log(satisfies('19.0.0', '^18.19 <19 || >20.4.0')); // false
console.log(satisfies('19.0.0', '^18.19 || >20.4.0')); // false
console.log(satisfies('20.0.0', '^18.19 <19 || >20.4.0')); // false
console.log(satisfies('20.0.0', '^18.19 || >20.4.0')); // false
console.log(satisfies('20.4.0', '^18.19 <19 || >20.4.0')); // false
console.log(satisfies('20.4.0', '^18.19 || >20.4.0')); // false
console.log(satisfies('20.5.0', '^18.19 <19 || >20.4.0')); // true
console.log(satisfies('20.5.0', '^18.19 || >20.4.0')); // true
However, maybe we could be a little clearer using ^18.9.0 || >=20.5.0
instead. So that no users is confused about whether 20.4.0
is supported or not.
using ^18.9.0 || >=20.5.0 instead. So that no users is confused about whether 20.4.0 is supported or not.
๐
Sorry, I made typo, this is ^18.19.0 || >=20.5.0
.