【问题标题】:WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree警告:您当前正在运行 @typescript-eslint/typescript-estree 未正式支持的 TypeScript 版本
【发布时间】:2022-10-04 16:48:07
【问题描述】:

您好,我的终端出现了一些错误,它说我需要使用 4.4.0 版本,而我当前的版本是...

在我的项目中,我当前的打字稿版本如下,

    "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",

此外,当我试图跑步时npm 运行开发命令或npx eslint 。是错误显示给我,如下所示,

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

   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.

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

我该如何解决这个问题,我在谷歌做了很多研究,但没有任何效果。这对我会有很大的帮助。

【问题讨论】:

    标签: reactjs typescript ubuntu warnings react-scripts


    【解决方案1】:

    我不会降级我的 Typescript,因为你会错过更新的 TS 功能 - 我会找到更新 @typescript-eslint/typescript-estree 的方法。

    您可能没有直接安装它,这可能是另一个包的依赖项,@typescript-eslint/experimental-utils 例如是 @typescript-eslint/eslint-plugin 的依赖项,因此在您的 yarn.lock / package.lock 文件中查找父包并将其碰撞,结果它也应该碰到@typescript-eslint/typescript-estree

    【讨论】:

      【解决方案2】:

      尝试使用 >=3.3.1 <4.4.0 之间的打字稿版本。 Here 你有可用的打字稿版本列表。

      更改版本后,删除节点模块文件夹和包-lock.json文件。然后执行npm install

      【讨论】:

      • 非常感谢我已经解决了这个问题,并且我添加了相关的支持版本,即 typescript 4.3.2 并且一切正常。再次感谢您的帮助。
      猜你喜欢
      • 1970-01-01
      • 2023-02-07
      • 2021-10-16
      • 2022-01-24
      • 2021-01-11
      • 2019-12-06
      • 2019-05-28
      • 2020-11-09
      • 2020-01-29
      相关资源
      最近更新 更多