我有Electron + Angular应用程序。我想将Typescript用于Electron,所以我有main.ts文件,并想使用“ tsc main.ts”将其编译为main.js。但是,出现以下错误:
node_modules/@types/selenium-webdriver/remote.d.ts:139:29-错误TS2304:找不到名称“地图”。
仍然会生成main.js,并且当我运行电子时无需使用tsc命令。但是,我希望它由一个脚本运行而没有任何错误。
我的tsconfig.json包含:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试了目标和库配置的各种组合(例如es6),但没有成功。
有人可以帮忙吗?非常感谢!