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$

4
  • 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. Commented Jun 25, 2017 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 Commented Jun 25, 2017 at 23:02
  • Thanks for the info, I explained it in an answer. Commented Jun 25, 2017 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? Commented Jun 25, 2017 at 23:10

3 Answers 3

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
Sign up to request clarification or add additional context in comments.

3 Comments

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?
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
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
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.

Comments

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)

1 Comment

I removed @angular/compiler-cli from devdependencies to dependencies and renamed tsconfig.app.json to tsconfig.json. then everything started working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.