Skip to content
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

Allow all 12.x and 14.x Node.js versions to be used #4465

Closed
2 of 3 tasks
lirantal opened this issue Jan 20, 2022 · 3 comments
Closed
2 of 3 tasks

Allow all 12.x and 14.x Node.js versions to be used #4465

lirantal opened this issue Jan 20, 2022 · 3 comments
Labels
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin wontfix This will not be worked on

Comments

@lirantal
Copy link

lirantal commented Jan 20, 2022

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/eslint-plugin@5.10.0: 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

  1. Run npm init -y

  2. Use Node.js version v16 (any patch and any minor)

  3. Run npm install

  4. All work fine

  5. Run npm init -y

  6. Use Node.js version v14.15.1

  7. Update the package.json to include:

  "engines": {
    "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
  },
  1. Run npm install
  2. 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
@lirantal lirantal added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jan 20, 2022
@bradzacher
Copy link
Member

Is there a reason for specifically setting a lower cap on v12.22 and v14.17 minor versions?

We sync our engine requirements with ESLint. As they push forward, so do we.
Whilst we might not have an explicit need, we test against newer versions only.

We do not test on older versions of node, so we provide no support for older versions.
If it works - it works, if it doesn't - you're on your own. You're free to use --ignore-engines or similar to bypass the check in yarn if you wish to use it.

@bradzacher bradzacher added wontfix This will not be worked on working as intended Issues that are closed as they are working as intended and removed triage Waiting for maintainers to take a look working as intended Issues that are closed as they are working as intended labels Jan 20, 2022
@lirantal
Copy link
Author

Syncing up with ESLint version requirements make a lot of sense, thanks for explaining Brad.

@earshinov
Copy link

Related: eslint/eslint#15198

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants