我正在嘗試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> {
~~~~~~~~~~~~~~~~~~~~~~~~~
我可以看到它與我什至沒有安裝自己的型別模塊有關。知道這是從哪里來的嗎?
uj5u.com熱心網友回復:
你可以試著把
"compilerOptions": {
"skipLibCheck": true
},
進入你的 tsconfig 檔案。這將跳過 node_modules 的型別檢查。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/377264.html
上一篇:從所有鍵中洗掉下劃線前綴
