2

I know this is a frequently asked question, but i can't resolve my issue. I have node and npm installed using nvm, all up to date, I clone my repository to desktop from https://github.com/CHBaker/First-Angular-App then i install the ng cli and do ng serve getting this error.

I have already followed steps in many threads about this issue including this thread Angular2 CLI error "@angular/compiler-cli" package was not properly installed

terminal error: Charless-MacBook-Pro:First-Angular-App charlesbaker$ ng serve The "@angular/compiler-cli" package was not properly installed. Error: The "@angular/compiler-cli" package was not properly installed. at Object.<anonymous> (/Users/charlesbaker/.nvm/versions/node/v8.1.2/lib/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/index.js:14:11) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/Users/charlesbaker/.nvm/versions/node/v8.1.2/lib/node_modules/@angular/cli/tasks/eject.js:10:19) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) Charless-MacBook-Pro:First-Angular-App charlesbaker$

FussinHussin
  • 1,718
  • 4
  • 19
  • 39
  • Did you try uninstalling and reinstalling only the broken package? It fixes it for me. Also, please provide more info such as your OS and node/npm versions. – Ploppy Jun 25 '17 at 22:53
  • I did not. i'm fairly new to angular, what steps did you take to do that? is the broken package just the angular compiler cli? my node and npm versions are v8.1.2 and 5.0.3, running OS Sierra 10.12.5 – FussinHussin Jun 25 '17 at 23:02
  • Thanks for the info, I explained it in an answer. – Ploppy Jun 25 '17 at 23:06
  • after uninstalling and re installing @angular/compiler-cli i get the following error ``` ENOENT: no such file or directory, stat '/Users/charlesbaker/Desktop/First-Angular-App/src/tsconfig.app.json' ``` when i change the src/tsconfig.json to tsconfig.app.json it works. is this just a bad workaround? what is the 'right' way to handle this? – FussinHussin Jun 25 '17 at 23:10

3 Answers3

1

To reinstall the compiler-cli follow these steps:

Open your terminal at the root of your project and execute the following commands:

  • npm uninstall @angular/compiler-cli
  • npm install --save-dev @angular/compiler-cli
Ploppy
  • 14,810
  • 6
  • 41
  • 58
  • after uninstalling and re installing @angular/compiler-cli i get the following error ``` ENOENT: no such file or directory, stat '/Users/charlesbaker/Desktop/First-Angular-App/src/tsconfig.‌​app.json' ``` when i change the src/tsconfig.json to tsconfig.app.json it works. is this just a bad workaround? what is the 'right' way to handle this? – FussinHussin Jun 25 '17 at 23:26
  • I don't think it's supposed to happen, your project probably broke somehow. If it works its ok but you can try reinstalling the entire project, delete your node_modules folder, then `npm install --save-dev @angular/cli` and `npm install` – Ploppy Jun 25 '17 at 23:41
  • I had tried that, with no luck. not sure whats going on, but somehow i just had an old version of a couple dependencies or something. thanks for the help though – FussinHussin Jun 26 '17 at 00:34
1

For me when I got the same problem, I just went inside my project folder and did the ng-serve command once again. That solved the issue in my case.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
HexaCrop
  • 3,863
  • 2
  • 23
  • 50
0

fixed by changing src/tsconfig.json to tsconfig.app.json, I compared this with a test project by running ng new TESTAPP and comparing the file names. tsconfig.app.json is the updated name for the latest version as of (6/25/17)

FussinHussin
  • 1,718
  • 4
  • 19
  • 39
  • 1
    I removed @angular/compiler-cli from devdependencies to dependencies and renamed tsconfig.app.json to tsconfig.json. then everything started working. – Prasad Sep 17 '17 at 08:52