Angular 6 and karma 'Can not load "@angular-devkit/build-angular", it is not registered'

My solution was a little different, as I had to move the karma.conf.js.

  1. Update all dependencies and make sure the app itself works as intented
  2. If not done already: Replacing every occurrence of @angular/cli with @angular-devkit/build-angular in the karma.conf.js
  3. Removing the files and the preprocessor configs from the karma.conf.js completely. This is all defined in the angular.json and should be handled automatically by the @anguler-devkit karma plugin.

Could not find module "@angular-devkit/build-angular"

here is what worked for my project:

  1. npm install -g @angular/cli
  2. npm install @angular/cli
  3. ng update @angular/cli --migrate-only --from=1.7.0
  4. ng update @angular/core
  5. npm install rxjs-compat
  6. ng serve

I hope this works for you!


I followed this guide to do a clean migration of the project, which solved the same issue for me.