6

I created a new Angular project and get the following error:

This likely means that the library (@angular/platform-browser/animations) which declares BrowserAnimationsModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy

My Angular version is: 9.0.7

As suggested here I tried to remove the node_modules and reinstall it, but it didn't help.

ruth
  • 29,535
  • 4
  • 30
  • 57
MJ X
  • 8,506
  • 12
  • 74
  • 99

2 Answers2

2

From issue comment from angular repository https://github.com/angular/angular/issues/29960#issuecomment-484420080

If you set "target": "es5" in your tsconfig.app.json, then this bug does not happen.

Franky238
  • 511
  • 5
  • 21
2
Package.json
 "scripts": {
   "postinstall": "ngcc"
  }

tsConfig.json
  "angularCompilerOptions": {
     "enableIvy": false
  }

Delete the node modules folder & Install node_modules: npm i --save

build project: ng build & start project: ng serve

rohit.khurmi095
  • 2,203
  • 1
  • 14
  • 12