gpt4 book ai didi

javascript - 构建 : Duplicate identifier 'prototype'

转载 作者:太空狗 更新时间:2023-10-29 17:41:01 24 4
gpt4 key购买 nike

当我尝试构建我的应用程序时,出现以下错误:

1>node_modules\angular2\typings\browser.d.ts(6,14): error TS2300: Build: Duplicate identifier 'PromiseConstructor'.
1>node_modules\angular2\typings\es6-collections\es6-collections.d.ts(22,5): error TS2300: Build: Duplicate identifier 'done'.
1>node_modules\angular2\typings\es6-collections\es6-collections.d.ts(23,5): error TS2300: Build: Duplicate identifier 'value'.
1>node_modules\angular2\typings\es6-collections\es6-collections.d.ts(46,5): error TS2300: Build: Duplicate identifier 'size'.
1>node_modules\angular2\typings\es6-collections\es6-collections.d.ts(52,5): error TS2300: Build: Duplicate identifier 'prototype'.
1>node_modules\angular2\typings\es6-collections\es6-collections.d.ts(66,5): error TS2300: Build: Duplicate identifier 'size'.
1>node_modules\angular2\typings\es6-collections\es6-collections.d.ts(72,5): error TS2300: Build: Duplicate identifier 'prototype'.
1>node_modules\angular2\typings\es6-collections\es6-collections.d.ts(88,5): error TS2300: Build: Duplicate identifier 'prototype'.
1>node_modules\angular2\typings\es6-collections\es6-collections.d.ts(103,5): error TS2300: Build: Duplicate identifier 'prototype'.
1>node_modules\angular2\typings\es6-promise\es6-promise.d.ts(11,15): error TS2300: Build: Duplicate identifier 'Promise'.
1>node_modules\angular2\typings\es6-promise\es6-promise.d.ts(42,16): error TS2300: Build: Duplicate identifier 'Promise'.

我不明白为什么。这是我的 tsconfig:

{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../wwwroot/appScripts/",
"removeComments": false,
"sourceMap": true,
"target": "es5"
},
"exclude": [
"node_modules"
]
}

我不知道为什么会出现此错误。我遵循了本教程:http://www.mithunvp.com/angular-2-in-asp-net-5-typescript-visual-studio-2015/

最佳答案


检查你的 es6-collections.d.ts 是否导入了不止一次。多次引用时会出现此类问题。

关于javascript - 构建 : Duplicate identifier 'prototype' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35871250/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com