Getting problem while running Angular 2/4/6 app or Updating angular CLI
- Problem with ng serve
- An issue with updating Angular CLI OR
- Local workspace file (‘angular.json‘) could not be found.
Here is Solution for above issues
1. Uninstall and clean (global)
rm -rf node_modules dist npm uninstall -g @angular/cli npm cache clean
2. Reinstall and play (global)
npm install -g @angular/cli@latest npm install ng serve
If above solution does not work then try following steps.
Step 1: npm install -g @angular/cli@latest
Step 2: ng new name-of-project (ignore if project already created)
Step 3: cd name-of-project (ignore if project already created)
Step 4: npm install @angular/cli –save-dev
Step 5: npm install @angular/compiler-cli –save-dev
Step 6: ng serve