Angular 9 - NGCC fails with an unhandled exception

This problem (NGCC failed) was encountered by me and my colleague developer on our localhost machines.

It would be important to remark that the dev and prod machines were running well.

In order to solve this problem we've followed the next steps:

  1. in tsconfig.json, in angularCompilerOptions have set ("enableIvy": false)
  2. updated the nodeJS to the last version: (executing node -v returned v14.3.0)
  3. have deleted the node_modules folder: (executing "rm .\node_modules\" [on windows], make sure it has been deleted successfully)
  4. have installed the packages: (executing npm i )
  5. here the project is ready to be built. It builds and runs without errors now.

I wish this helps you and other people in situations like this.


In my particular case the @angular-devkit/build-angular was updated to "^0.1001.2" in my package.json after running the npm audit fix. (This version seems to belong to angular 10, instead of the local projects' angular version (v9.1.7))

After reverting this change, everything started working again :

"@angular-devkit/build-angular": "~0.901.6"


Using terminal/cmd,

1st Step:

ng update @angular/cli @angular/core

2nd Step:

ng update

3rd Step:

ng serve

Fixed mine.

NOTE Your custom css files in bootstrap folder might get deleted. Back them up before and place them back after the update!