0

I am getting below error while installing the package @typescript-eslint/eslint-plugin

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR! dev eslint@"^9.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^8.56.0" from @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/parser
npm ERR! peer @typescript-eslint/parser@"^7.0.0" from @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! dev @typescript-eslint/eslint-plugin@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/surajsokasane/.npm/eresolve-report.txt for a full report.

Which means the package @typescript-eslint/eslint-plugin which is peer of @typescript-eslint/parser needs eslint^8.56.0.

But the latest version of eslint is the one I have installed - 9.6.0. If I downgrade the eslint to 8.56, the issue will most probably be solved. As I have just installed it, there won't be any headache.

My question is, why latest version on @typescript-eslint/eslint-plugin is not compatible with latest version of eslint?

3

1 Answer 1

0

The root issue is that, as JSON Derulo commented, you're on two incompatible versions:

  • eslint: major version 9
  • typescript-eslint: major version 7, which supports eslint 8 but not 9

typescript-eslint's major version 8 supports eslint 9: https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta. It's in beta at time of answering but at the end of July 2024 will be stable: https://github.com/typescript-eslint/typescript-eslint/discussions/8766.

Not the answer you're looking for? Browse other questions tagged or ask your own question.