[英]TS2304 Cannot find name 'Set' in electron-builder
我想在我的Electron Application中使用電子生成器中的AppUpdater。
在我的main.ts文件中導入更新程序時:
import { autoUpdater } from "electron-updater"
運行應用程序時出現以下錯誤:
node_modules/builder-util-runtime/out/httpExecutor.d.ts(54,69): error TS2304: Cannot find name 'Set'.
node_modules/builder-util-runtime/out/rfc2253Parser.d.ts(1,47): error TS2304: Cannot find name 'Map'.
經過研究,似乎我必須向Typescript轉換器展示如何處理這些特定的類型,但在我的ts.config文件中嘗試不同的目標/庫組合,似乎沒有任何幫助。
如何使這個打字稿定義文件有效?
這是我的配置文件:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowJs": false,
"target": "es5",
"paths": {
"environments": [
"./environments"
]
},
"types": [
"node",
"jasmine"
],
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom"
]
}
}
嘗試運行npm install --save-dev @types/es6-collections
您可以在此處找到解決方案的更多上下文https://github.com/DefinitelyTyped/DefinitelyTyped/issues/16587
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.