Upgrading Angular CLI to the latest version?

Asked

Viewed 2,096 times

0

I started a new angular design, it works well for me when I use:

npm start

However, I’m trying to use

ng serve

So I tried that:

npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest

However, I am getting this error even when I run the command:

ng --version

An invalid Configuration file was found ['/home/Edson/.angular.json']. Please delete the file before running the command.

Does anyone know why this is happening?

  • 1

    Did you install it globally as well? With command: npm install -g @angular/cli. Since version 6.x angular-cli has used the.json angular file instead of . angular-cli.json you have which one of them?

  • Now this error is appearing "The serve command requires to be run in an Angular project, but a project Definition could not be found."

  • https://www.npmjs.com/package/@angular/cli#updating-angular-cli

  • 1

    If you update the angular-cli to verses 6> you have to update your project tbm to be compatible.

  • 1

    @Edsoncezar this is a problem that has been happening but in angular-cli 7, you can follow here https://github.com/angular/angular-cli/issues/12198 but in short, it happens when there is a file .angular.json in some root directory of yours, e.g.: C:// or your user, etc.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.