ivy error - The ngcc compiler has changed since the last ngcc build

Viewed 3370

I get this error when i trying to compile with ivy :

ERROR in The ngcc compiler has changed since the last ngcc build.
Please completely remove `node_modules` and try again.

I tried to completely remove node_modules and reinstall, but the error remains

4 Answers

In my case it is monorepo , repo with client, server and shared.

So remove node-modules in parent folder solve the error.

The site that I created only 2 weeks ago in Angular 8, and refactored for Ivy compiler, gave that error today after doing ng updates on /cli and /core, on npm start. After some web searches, I decided not to delete node_modules in that project, but updated my global Angular/CLI, then created a new app with it and fully migrated my previous site. Which worked, it now serves and builds. My work is fairly simple but I do have lazy loading and router etc.

Here are some details:

"dependencies": { "@angular/animations": "~8.0.1", "@angular/common": "~8.0.1", "@angular/compiler": "~8.0.1", "@angular/core": "~8.0.1", .... "devDependencies": { "@angular-devkit/build-angular": "~0.800.0", "@angular/cli": "~8.0.3", "@angular/compiler-cli": "~8.0.1",

and tsconfig.json:

, "lib": [ "es2018", "dom" ] }, "angularCompilerOptions": { "enableIvy": true, }

  • Go to node_modules/@angular/compiler-cli/ngcc/
  • There will be a lockfile 'ngcc_lock_file'
  • Delete the lockfile and restart
Related