繁体   English   中英

TS2304在电子制造商中找不到名称'Set'

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM