0

I have downloaded a MEAN stack project saved on bitbucket and trying to run front end part (Angular 2) locally by navigating to the angular folder and doing ng serve but it is giving following error

"The serve command requires to be run in an Angular project, but a project definition could not be found."

I have installed latest version(7.0.4) of angular cli on my local machine.

Please help with this problem.

Thank you so much in advance.

Parvez
  • 89
  • 1
  • 11

2 Answers2

0

You need to update to latest version of angular cli.This can be achieved using :

ng update @angular/cli

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • What if I don't want update the project from angular 2 to latest version ? – Parvez Nov 04 '18 at 06:28
  • After running above command I am getting "Package not installed: "@angular/cli". Skipping." – Parvez Nov 04 '18 at 06:46
  • Package not installed: "@angular/cli". Skipping. We analyzed your package.json, there are some packages to update: Name Version Command to update ------------------------------------------------------------------------- @angular/core 2.4.10 -> 7.0.2 ng update @angular/core rxjs 5.5.12 -> 6.3.3 ng update rxjs There might be additional packages that are outdated. Run "ng update --all" to try to update all at the same time. – Parvez Nov 04 '18 at 06:49
0

The reason is that new angular cli update makes angular-cli.json redundant, and it is replaced with angular.json instead.

Try

ng update @angular/cli

OR

ng update @angular/cli --migrate-only --from={previous angular version}
Satish Saini
  • 2,880
  • 3
  • 24
  • 38