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"
  ]
}
1

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

What if you're using both Jasmine and Mocha?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.