30

Hello there I am getting some error in my terminal and its say i need to use 4.4.0 version and my current version is ...

In my project my current typescript version is given below,

    "typescript": "^4.4.2",
    "typedoc": "^0.21.8",
    "react-scripts": "^3.4.4",
    "@typescript-eslint/eslint-plugin": "^4.29.3",
    "@typescript-eslint/parser": "^4.29.3",

Moreover, when I am trying to run npm run dev commands or npx eslint . is error are showing me which is given below,

    =============

   WARNING: You are currently running a version of TypeScript which is not 
   officially supported by @typescript-eslint/typescript-estree.

    You may find that it works just fine, or you may not.

   SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.4.0

   YOUR TYPESCRIPT VERSION: 4.4.2

     Please only submit bug reports when using the officially supported 
    version.

    =============

How can i fix this issue and I have done a lot of research in google but nothing is working. It would be great help for me.

Barbie Doll
  • 401
  • 1
  • 4
  • 7

6 Answers6

14

I was struggling with the same warning. Solved it by updating eslint and related packages to the latest by running:

npm i eslint@latest @typescript-eslint/parser@latest @typescript-eslint/eslint-plugin@latest --save

Now, I have the following versions in my package.json and I am not receiving the warning anymore

"eslint": "^8.38.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.22.0",
"typescript": "^5.0.4"
Anum
  • 178
  • 1
  • 6
  • not necessarily install latest, but go to your package.json and ensure to give enough slack for an update ( eg, change `"@typescript-eslint/eslint-plugin": "^5.25.0",` => `"@typescript-eslint/eslint-plugin": "^5" `), then `npm update @typescript-eslint/eslint-plugin` etc. – til Jul 27 '23 at 15:17
13

I wouldn't downgrade my Typescript, as you will miss out on newer TS features - I would find a way to update @typescript-eslint/typescript-estree.

You might not have this installed directly and this might be a dependancy of another package, @typescript-eslint/experimental-utils which is dependancy of @typescript-eslint/eslint-plugin for instance, so track down the parent package in your yarn.lock / package.lock file and bump it, as a result it should bump @typescript-eslint/typescript-estree too.

Ivo
  • 364
  • 3
  • 7
  • 1
    I am having the same issue. Can you provide a bit more clarity on what you mean by 'track down the parent package ... and bump it" ? I've never actually manually edited a lock file before. This is my pnpm-lock.yaml file: https://github.com/currenthandle/react-road-to-enterprise/blob/main/pnpm-lock.yaml – currenthandle Nov 26 '22 at 21:31
  • 1
    Hm, your case seems a bit different than mine - so I had 3 packages which used different versions of `@typescript-eslint/typescript-estree`, one of those packages was using `@typescript-eslint/typescript-estree@1.4.0`, the other two were using `5.0.x` and `4.x.x`. So when I updated the first package, this resulted updating the typescript-estree dependancy and the warning message disappeared. – Ivo Dec 06 '22 at 12:22
1

I'm using yarn, so I increased the version of @typescript-eslint/typescript-estree using resolutions in the package.json, and the warning disappeared. npm seems to be able to use overrides.

package.json

  "resolutions": {
    "@typescript-eslint/typescript-estree": "^5.59.2"
  },
Masamoto Miyata
  • 171
  • 4
  • 9
1

In my case, the issue was an outdated eslint-config-next. Make sure to update that, too, on top of updating @typescript-eslint/parser and @typescript-eslint/eslint-plugin.

Paul Razvan Berg
  • 16,949
  • 9
  • 76
  • 114
-1

For the future. You only need to fix the typescript version to fixed. Maybe the latest versions of @typescript-eslint... don't support your TS version.

-7

Try using a typescript version between >=3.3.1 <4.4.0. Here you have the list of typescript versions available.

After changing the version, remove node_modules folder and package-lock.json file. Then execute npm install

  • Thank you very much I had already resolve this issue and I had added relevant supported version which was 4.3.2 of typescript and everything is working fine. Thanks once again for your help. – Barbie Doll Jun 30 '22 at 09:14