操作系统:Windows 10
网络风暴:ver11.0.1
AngularJS:ver2.0.0-alpha.46.46
WebStorm设置
项目结构:
- bin
- node_modules/angular2
- src/tsconfig.json
- package.jsonPackage.json
{
"name": "TypeScriptHTMLApp2",
"version": "1.0.0",
"dependencies": {
"angular2": "2.0.0-alpha.46",
"es6-shim": "^0.33.13",
"systemjs": "0.19.6"
},
"devDependencies": {
"babel-preset-es2015": "^6.3.13"
}
}tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules"
]
}注意: webstorm项目窗口中的node_modules文件夹,也被设置为“排除”。
因此,webstorm正在抛出以下重复的标识符错误消息:
C:\Program Files (x86)\JetBrains\WebStorm 11.0.1\plugins\JavaScriptLanguage\typescriptCompiler\external\lib.es6.d.ts
Error:(3841, 14) TS2300: Duplicate identifier 'PropertyKey'.
Error:(4034, 5) TS2300: Duplicate identifier 'EPSILON'.
Error:(4069, 5) TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'.
Error:(4076, 5) TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'.
Error:(4362, 5) TS2300: Duplicate identifier 'done'.
Error:(4363, 5) TS2300: Duplicate identifier 'value'.
Error:(4592, 5) TS2300: Duplicate identifier 'flags'.
Error:(4620, 5) TS2300: Duplicate identifier 'size'.
Error:(4630, 5) TS2300: Duplicate identifier 'prototype'.
Error:(4647, 5) TS2300: Duplicate identifier 'prototype'.
Error:(4659, 5) TS2300: Duplicate identifier 'size'.
Error:(4669, 5) TS2300: Duplicate identifier 'prototype'.
Error:(4685, 5) TS2300: Duplicate identifier 'prototype'.
Error:(5072, 5) TS2300: Duplicate identifier 'prototype'.
C:\Users\Theo\Documents\WebStorm\Projects\TypeScriptHTMLApp2\TypeScriptHTMLApp2\node_modules\angular2\typings\es6-shim\es6-shim.d.ts
Error:(6, 14) TS2300: Duplicate identifier 'PropertyKey'.
Error:(9, 5) TS2300: Duplicate identifier 'done'.
Error:(10, 5) TS2300: Duplicate identifier 'value'.
Error:(248, 5) TS2300: Duplicate identifier 'EPSILON'.
Error:(283, 5) TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'.
Error:(290, 5) TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'.
Error:(346, 5) TS2300: Duplicate identifier 'flags'.
Error:(498, 5) TS2300: Duplicate identifier 'prototype'.
Error:(561, 5) TS2300: Duplicate identifier 'size'.
Error:(570, 5) TS2300: Duplicate identifier 'prototype'.
Error:(581, 5) TS2300: Duplicate identifier 'size'.
Error:(590, 5) TS2300: Duplicate identifier 'prototype'.
Error:(605, 5) TS2300: Duplicate identifier 'prototype'.
Error:(619, 5) TS2300: Duplicate identifier 'prototype'.我如何解决这个问题?
事先非常感谢
发布于 2019-08-19 07:59:55
当两个文件在编辑器中打开时,就会发生这种情况。如果你关闭其中一个文件,错误就会消失.
https://stackoverflow.com/questions/34198676
复制相似问题