小编Mic*_*nka的帖子

打字稿编译器:找不到名称“地图”

我有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),但没有成功。

有人可以帮忙吗?非常感谢!

typescript electron angular

3
推荐指数
2
解决办法
2874
查看次数

标签 统计

angular ×1

electron ×1

typescript ×1