2017-05-26 58 views
0

「地圖」,我有以下錯誤突然發生重複標識符離子

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 
    } 
} 

ion -v 3.2.0

+0

你是否因類型聲明而在類型數組中包含jasmine? –

回答

0

查看關於@types,typeRoots和 的文章tsconfig.json文檔。

由於您已經

"types": [ 
    "jasmine" 
], 

打字稿只會挑jasmine類型聲明。您還應該將googlemaps添加到陣列中。如打字稿被配置成通過默認來看待@types從node_modules

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

或者從tsconfig.json移除類型陣列。

查詢this answer瞭解更多信息。

+0

感謝您的注意,我試過兩種方法,但仍然有問題 – Ananth

+0

同樣的錯誤?你嘗試過''typeRoots':[ 「./node_modules/@types」 「 –