Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 build error: '=' expected in index.d.ts

Tags:

angular

I'm using Angular 2 and out of seemingly nowhere, I started getting the following build error in my node_modules/@types/jasmine/index.d.ts:

Build: '=' expected

Luckily I was able to fix this, but I can't find this question anywhere on Stackoverflow, so I figured I'd post a question and answer it myself for anyone who runs into the same issue.

like image 215
Bryan Avatar asked Feb 11 '17 23:02

Bryan


1 Answers

The newest version of Jasmine seems to have issues with TypeScript versions below 2.1, and Angular 2 seems to have issues with TypeScript versions 2.1+, so to fix this problem, simply change "@types/jasmine": "^2.5.36" to "@types/jasmine": "2.5.36" (i.e., remove the caret) in your package.json file. You may need to delete your node_modules folder before running npm install and restoring your packages.

like image 81
Bryan Avatar answered Oct 20 '22 02:10

Bryan