VS2015 构建失败 "Duplicate identifier" Angular 2
VS2015 build fail "Duplicate identifier" Angular 2
我在安装和卸载 angular-cli:
后构建失败并出现此错误
1>...\node_modules\@types\jasmine\index.d.ts(9,18): error TS2300: Build:Duplicate identifier 'describe'.
1>...\node_modules\@types\jasmine\index.d.ts(11,18): error TS2300: Build:Duplicate identifier 'xdescribe'.
1>...\node_modules\@types\jasmine\index.d.ts(13,18): error TS2300: Build:Duplicate identifier 'it'.
1>...\node_modules\@types\jasmine\index.d.ts(15,18): error TS2300: Build:Duplicate identifier 'xit'.
1>...\node_modules\@types\mocha\index.d.ts(33,13): error TS2300: Build:Duplicate identifier 'describe'.
1>...\node_modules\@types\mocha\index.d.ts(34,13): error TS2300: Build:Duplicate identifier 'xdescribe'.
1>...\node_modules\@types\mocha\index.d.ts(39,13): error TS2300: Build:Duplicate identifier 'it'.
1>...\node_modules\@types\mocha\index.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
。
我在安装和卸载 angular-cli:
后构建失败并出现此错误1>...\node_modules\@types\jasmine\index.d.ts(9,18): error TS2300: Build:Duplicate identifier 'describe'.
1>...\node_modules\@types\jasmine\index.d.ts(11,18): error TS2300: Build:Duplicate identifier 'xdescribe'.
1>...\node_modules\@types\jasmine\index.d.ts(13,18): error TS2300: Build:Duplicate identifier 'it'.
1>...\node_modules\@types\jasmine\index.d.ts(15,18): error TS2300: Build:Duplicate identifier 'xit'.
1>...\node_modules\@types\mocha\index.d.ts(33,13): error TS2300: Build:Duplicate identifier 'describe'.
1>...\node_modules\@types\mocha\index.d.ts(34,13): error TS2300: Build:Duplicate identifier 'xdescribe'.
1>...\node_modules\@types\mocha\index.d.ts(39,13): error TS2300: Build:Duplicate identifier 'it'.
1>...\node_modules\@types\mocha\index.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
。