0

When I try to install a new package for some reason npm removes all packages related to angular cli. When I reinstall angular cli I get this error message:

C:\SomeApp\Main\WebUI>ng serve

The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
    at Object.<anonymous> (C:\SomeApp\Main\WebUI\node_modules\@ngtools\webpack\src\index.js:14:11)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\SomeApp\Main\WebUI\node_modules\@angular\cli\tasks\eject.js:10:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19
purplePanda
  • 169
  • 1
  • 1
  • 10
  • Possible duplicate of [The "@angular/compiler-cli" package was not properly installed](https://stackoverflow.com/questions/43351136/the-angular-compiler-cli-package-was-not-properly-installed) – IWillScoop Jun 28 '17 at 21:40

2 Answers2

0

when having this problem you can update angular cli at first try.

https://github.com/angular/angular-cli#updating-angular-cli

be sure to run this commands.

  • delete node_modules
  • npm cache clean
  • npm install

be also sure that this are dependencies in your package.json file for example

  "@angular/cli": "1.0.0",
  "@angular/compiler-cli": "^4.0.0",

hope it helps..

-1

I just encountered the same error yesterday. What worked for me after a day of trying almost all the possible solutions was: npm install -g -f angular-cli

It will replace the @angular/cli with @angular-cli to fix the problem for now, then you can work on updating it to the new version. Also check this link as it has great info on this issue.