【发布时间】:2018-05-30 14:45:39
【问题描述】:
我想在我的 Electron 应用程序中使用 electron-builder 中的 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"
]
}
}
【问题讨论】:
-
请告诉我 electron-builder 的版本
标签: javascript typescript electron-builder