0

我正在尝试tsc在一个使用 Vite 搭建的 React 项目上运行——所有其他命令运行良好,项目加载和构建成功,但是运行时tsc出现此错误:

../../node_modules/@types/download/index.d.ts:9:10 - error TS2614: Module '"got"' has no exported member 'GotEmitter'. Did you mean to use 'import GotEmitter from "got"' instead?

9 import { GotEmitter, GotOptions } from "got";
           ~~~~~~~~~~

../../node_modules/@types/download/index.d.ts:13:58 - error TS2315: Type 'GotOptions' is not generic.

13     interface DownloadOptions extends DecompressOptions, GotOptions<string | null> {
                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~

我可以看到它与我自己没有安装的类型模块有关。知道这是从哪里来的吗?

4

1 回答 1

1

你可以试着把

  "compilerOptions": {
    "skipLibCheck": true
  },

进入你的 tsconfig 文件。这将跳过 node_modules 的类型检查。

于 2021-12-08T17:52:13.223 回答