重复的标识符' Map'在离子

时间:2017-05-26 04:06:00

标签: ionic-framework ionic2

我突然发生以下错误

Typescript Error
Duplicate identifier 'Map'.
/node_modules/@types/googlemaps/index.d.ts

尝试过这种方式,但它没有修复

ionic 2 Duplicate identifier 'export='

我的tsconfig文件如下所示

{
  "compilerOptions": {
    "target": "es5",
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "sourceMap": true,
    "noUnusedParameters": false,
    "lib": [
      "dom",
      "es2015"
    ]
  },
  "types": [
    "jasmine"
  ],
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  },
  "awesomeTypescriptLoaderOptions": {
    "forkChecker": true,
    "useWebpackText": true
  }
}

ionic -v 3.2.0

1 个答案:

答案 0 :(得分:0)

查看@types,typeRoots和类型部分 在tsconfig.json文档中。

因为你已经包含了

"types": [
  "jasmine"
],

Typescript只会选择jasmine类型声明。您还应该将googlemaps添加到数组中。

"types": [
      "jasmine",
      "googlemaps
    ],

或者从tsconfig.json中删除types数组,因为typescript被配置为默认情况下从node_modules查看@types。

查看this answer以获取更多信息。

相关问题