1

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

lingar
  • 477
  • 1
  • 7
  • 25
  • possible duplicate of https://stackoverflow.com/questions/50333003/could-not-find-module-angular-devkit-build-angular – alokstar Oct 16 '18 at 20:56
  • As I said have tried without success @alokstar – lingar Oct 16 '18 at 21:00
  • okay, the other thing i can suggest is, if you updated any of your dependency, then try deleting and installing node modules again and then try to run it. – alokstar Oct 16 '18 at 21:06
  • build-angular is still WIP according to this https://www.npmjs.com/package/@angular-devkit/build-angular You may want to look at pulling a previous version of @angular/cli – Seth McClaine Oct 16 '18 at 21:13
  • Thanks @alokstar tried those things... – lingar Oct 19 '18 at 09:53
  • 1
    Thanks @SethMcClaine I'll consider this in future problems if will arise. Anyway your answer gave me the direction to the solution and it's solved. – lingar Oct 19 '18 at 09:55

1 Answers1

3

try this.

npm i --only=dev

after that npm install and run you project

Syed Kashif
  • 420
  • 6
  • 13