如何解决“无法找到”地图”,您需要更改目标库吗?'

时间:2019-05-23 16:55:01

标签: typescript

我现在正在学习TypeScript,将TS文件编译为JS文件时遇到问题。 在命令“ tsc test.ts”之后,会发生一些错误。

我试图将“ target:”更改为“ es6”,但没有任何效果。我还向“ lib”中添加了“ es6”:[],但是它也没有用。

tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es6",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom",
      "es6"
    ]
  }
}

node_modules/@types/selenium-webdriver/remote.d.ts:139:29-错误TS2583:找不到名称“地图”。您是否需要更改目标库?尝试更改 lib是es2015或更高版本的编译器选项。

139 setEnvironment(env:Map | {[name:string]:string} | null):this;

0 个答案:

没有答案