lingar
lingar

Reputation: 613

Could not find module "@angular-devkit/build-angular" with ng serve

Studying Angular, Trying to do those simple steps for generate new projects, but when I am trying to start ng-serve I got those errors:

 Could not find module "@angular-devkit/build-angular" from "C:\\Users\\lingar\\AngularProjects2\\project1".
    Error: Could not find module "@angular-devkit/build-angular" from "C:\\Users\\lingar\\AngularProjects2\\project1".
        at Object.resolve (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\core\node\resolve.js:141:11)
        at Observable.rxjs_1.Observable [as _subscribe] (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\architect\src\architect.js:132:40)
        at Observable._trySubscribe (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:43:25)
        at Observable.subscribe (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:29:22)
        at DoOperator.call (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\operators\tap.js:29:23)
        at Observable.subscribe (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\Observable.js:24:22)
        at C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\util\subscribeTo.js:22:31
        at Object.subscribeToResult (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\util\subscribeToResult.js:7:45)
        at MergeMapSubscriber._innerSub (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:75:38)
        at MergeMapSubscriber._tryNext (C:\Users\lingar\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:72:14)

Have tried a lot of those solutions without success.

Does someone have ideas ?

Edit: Solved!

Thanks to @Seth McClaine answer in the comments I went to the Technical Specifications of this module @angular-devkit/build-angular,

From there I took the install command and run it on the cmd :

npm i @angular-devkit/build-angular ,

and from then it's working well.

BTW - A weird issue that I've before the solution that only in the root user directory it's worked well.

@angular-devkit/build-angular specification

Upvotes: 1

Views: 7543

Answers (1)

Syed Kashif
Syed Kashif

Reputation: 422

try this.

npm i --only=dev

after that npm install and run you project

Upvotes: 3

Related Questions