Could not find module “@angular-devkit/build-angular”
Many time you get this error on your angular project. Mostly when you update angular and run ng serve
and you see somthing like below
Could not find module "@angular-devkit/build-angular" from "/home/Projects/myProjectName".
Error: Could not find module "@angular-devkit/build-angular" from "/home/Projects/myProjectName".
at Object.resolve (/home/Projects/myProjectName/node_modules/@angular-devkit/core/node/resolve.js:141:11)
at Observable.rxjs_1.Observable [as _subscribe] (/home/Projects/myProjectName/node_modules/@angular-devkit/architect/src/architect.js:132:40)
So, the answer is you need to Install @angular-devkit/build-angular
as dev dependency. This package is newly introduced in Angular new verison.
by using
npm install --save-dev @angular-devkit/build-angular
Or (linux)
yarn add @angular-devkit/build-angular --dev
If above is not working then use
npm update