lwc
lwc copied to clipboard
Specify the minimum supported version of Node in `engines`
Our engines
is woefully out of date:
https://github.com/salesforce/lwc/blob/1dba7074b4963ade06e872ef6cbb74b955aca377/package.json#L82-L84
... and this is in our root package.json
which isn't actually published to npm, so it doesn't do anything.
Instead, we should specify an engines
like this across all our packages:
"engines": {
"node": ">=18"
},
Arguably we should do this as a breaking change and just take this opportunity to bump our minimum supported Node version as well. Up to now, we have not really done a great job of communicating our minimum required version of Node, nor have we actually tested in multiple Node versions or bumped our major version when we dropped support for an older Node version. We should be more explicit about this.
See also: #4149
Running npm install global-jsdom jsdom lwc && node -r global-jsdom/register -e 'import("lwc").then(()=>console.log("success"))'
only succeeds for v16+.