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.
- Update all dependencies and make sure the app itself works as intented
- If not done already: Replacing every occurrence of
@angular/cli
with@angular-devkit/build-angular
in the karma.conf.js - Removing the
files
and thepreprocessor
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:
- npm install -g @angular/cli
- npm install @angular/cli
- ng update @angular/cli --migrate-only --from=1.7.0
- ng update @angular/core
- npm install rxjs-compat
- 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.