1

I have downgraded angular cli version and when I run the command ng serve, the following message is displayed

ERROR : This version of CLI is only compatible with Angular versions 0.0.0 || ^8.0.0-beta || >=8.0.0 <9.0.0 but Angular version 9.0.7 was found instead.

I looked at https://update.angular.io to find instructions on how to update Angular, but I do not want to update the angular CLI version, I want to downgrade the angular version from 9.0.7 to 8.0.0. How can I do that?

Tim
  • 5,435
  • 7
  • 42
  • 62
Shivani
  • 301
  • 5
  • 12

1 Answers1

1

First of all check your installed angular version through this command

ng --version

If you are already on desired version then you just have to update @angular/cli version in your project package.json file to make it compatible . Sometimes when we are using project developed on other machine causes this sort of issue

If ng --version shows that you are not on desired version then follow these steps to downgrade

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@8.0.0  // In your case 8.0.0

For complete guide check ReadMe part of this github repository.

Same problem here

Wasim
  • 600
  • 2
  • 11
  • 32
  • When i run the commands for installing cli , it does not effect or downgrade angular version. How can i downgrade the angular version? – Shivani Jul 01 '20 at 10:58
  • On which version are you currently ? – Wasim Jul 01 '20 at 11:06
  • Angular CLI: 8.2.2 Node: 12.13.0 OS: win32 x64 Angular: 9.0.7 => I want this to be 8.2.2 as well – Shivani Jul 01 '20 at 11:09
  • 1
    Did you globally run above commands ? Downgrading is basically uninstalling existing version and then install it again by mentioning required version. – Wasim Jul 01 '20 at 11:11
  • Yeah I did. It only downgrades the cli and not angular – Shivani Jul 01 '20 at 11:21
  • what is angular version in your `package.json` of project ? – Wasim Jul 01 '20 at 11:32
  • [Angular Cli vs Angular Version](https://stackoverflow.com/questions/46332383/how-to-check-the-angular-version) . Check this it would make easier for you to identify your peak problem. You seem confused – Wasim Jul 01 '20 at 11:40