Could not find the angular-devkit build-angular dev-server builder s node package

0 votes

The following error repeatedly occurs on the ng serve once the updating task to Angular 6.0.1 is completed.

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)

However, all is in order as shown on the screen after the ng update. Trying to use folders like the deleting node_modules along with a new npm installation has not given any results yet and is not helping. Could someone please help me with this?

Feb 8, 2022 in Java by Soham
• 9,730 points
• 10,804 views

1 answer to this question.

0 votes

The mode must be changed to Dev Dependency for @angular-devkit/build-angular. Angular 6.0 is the software to which this pack has been newly introduced and one must try the following two options, either of which should help solve your question. 

npm install --save-dev @angular-devkit/build-angular

                           OR

yarn add @angular-devkit/build-angular --dev

To know more about Angular, It's recommended to join Angular Online Course today.

answered Feb 8, 2022 by Rahul
• 9,690 points