Description
Since this commit b63013a and specifically the major version 5.x of the plugin, this package is requiring specifically the v14.17 version of Node.js as part of the engines
rule, such as:
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
Is there a reason for specifically setting a lower cap on v12.22 and v14.17 minor versions? Because if this is about being LTS compliant than the rule should really be:
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
},
To allow all supported (v12 and v14) Node.js versions to be used.
Why didn't we hear about this before?
This might not seem as an issue for npm users, because the default engines configuration is to shoot out a WARNING issue, rather than failing it, but some versions of yarn, such as 1.22.10 explicitly fails any npm install
of such projects. See here:
$ yarn
yarn install v1.22.10
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] π Resolving packages...
[2/4] π Fetching packages...
error @typescript-eslint/[email protected]: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "14.15.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
If you confirm this issue and would be open to receiving a fix to relax the Node.js engines config on package.json then I'm happy to push forward a quick PR to suggest the fix/
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
-
Run
npm init -y
-
Use Node.js version v16 (any patch and any minor)
-
Run
npm install
-
All work fine
-
Run
npm init -y
-
Use Node.js version v14.15.1
-
Update the
package.json
to include:
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
- Run
npm install
- Notice the installation fails due to incompatible Node.js engines version required.
Expected Result
Expect for all Node.js v14 and v12 to be supported, as is indeed the case (you can confirm here https://github.com/nodejs/Release#release-schedule)
Actual Result
Getting an error about incomplete Node.js version when trying to install this package
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.10.0 |
@typescript-eslint/parser |
X.Y.Z |
node |
14.15.1 |