我安装和卸载的Angular-cli后,我的构建失败了:
1>...node_modules@typesjasmineindex.d.ts(9,18): error TS2300: Build:Duplicate identifier 'describe'.
1>...node_modules@typesjasmineindex.d.ts(11,18): error TS2300: Build:Duplicate identifier 'xdescribe'.
1>...node_modules@typesjasmineindex.d.ts(13,18): error TS2300: Build:Duplicate identifier 'it'.
1>...node_modules@typesjasmineindex.d.ts(15,18): error TS2300: Build:Duplicate identifier 'xit'.
1>...node_modules@typesmochaindex.d.ts(33,13): error TS2300: Build:Duplicate identifier 'describe'.
1>...node_modules@typesmochaindex.d.ts(34,13): error TS2300: Build:Duplicate identifier 'xdescribe'.
1>...node_modules@typesmochaindex.d.ts(39,13): error TS2300: Build:Duplicate identifier 'it'.
1>...node_modules@typesmochaindex.d.ts(40,13): error TS2300: Build:Duplicate identifier 'xit'.
目前该解决方案非常凌乱,我是Angular 2/Typescript的新手,因此很难调试。我尝试了这个解决方案的打字稿,令人困惑的是"重复的标识符"。错误消息,但对我不起作用。
tsconfig.json:
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"*": [ "./node_modules/@types/*", "*" ]
},
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"types": [ ],
"noImplicitAny": false
},
"exclude": [
"node_modules",
"/node_modules",
"../node_modules",
"*node_modules*",
"/node_modules*",
"angular2",
"rxjs",
"typings"
]
}
看起来像.d.ts
定义碰撞。您是否同时使用Jasmine
和Mocha
?如果没有,请删除您不使用的任何一个,然后删除node_modules
文件夹并再次运行npm install
。