webpack和TypeScript 2.0:重复的标识符

时间:2016-10-11 09:01:25

标签: webpack

我目前正在使用TypeScript 2.0(和webpack 1.13.2)以及“@types”定义,我目前遇到以下错误:

  

[默认]中的错误### \ node_modules \ @types \ js-base64 \ index.d.ts:53:4   重复标识符'export ='。

我正在显示此错误,但它实际上并不是我唯一的错误。实际上,最近,我在项目中添加了“ckeditor”并通过

下载了相应的类型
npm install @types/ckeditor --save-dev

我的代码编译正确,但现在我有几十个“重复标识符”类型的错误。奇怪的是我通过“tsconfig.json”排除了“node_modules”:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true
  },
  "exclude": [
    "node_modules"
  ]
}

所以我不明白它是怎么产生警告/错误的。

顺便说一下,我尝试使用webpack 2,但它没有解决问题。

1 个答案:

答案 0 :(得分:0)

如果您还没有找到问题,可能是项目中存在两个定义文件的结果。

我遇到了这个问题,例如,当通过npm从typings迁移到@types时 - 我在两个位置都有一个定义。

相关问题