1

My build is failing with this error after I installed and uninstalled 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'.

The solution is very messy at the moment and I'm new to Angular 2/TypeScript, so it's being very hard to debug. I tried this solution Typescript, confusing "duplicate identifier" error message but it did not work for me.

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"
  ]
}
Jaeeun Lee
  • 3,056
  • 11
  • 40
  • 60
  • Possible duplicate of [Typescript, confusing "duplicate identifier" error message](https://stackoverflow.com/questions/31322525/typescript-confusing-duplicate-identifier-error-message) – JSess Jun 06 '17 at 15:52

1 Answers1

1

Looks like a .d.ts definition collision. Are you using both Jasmine and Mocha? If not, remove whichever you aren't using, then delete your node_modules folder and run npm install again.

Kevin Kipp
  • 417
  • 6
  • 14