How to downgrade to Angular 7 from Angular 8 or 9

Try like this :

ng --version
npm uninstall -g @angular/cli
npm cache clean --force

npm install -g @angular/[email protected]
ng --version

Update

The version 7.2.12 is given the following error :

npm ERR! code ETARGET npm ERR! notarget No matching version found for @angular/[email protected] npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

use this instead :

npm install -g @angular/[email protected]

you can specify the version while install,

npm install -g @angular/[email protected]

if you dont specify it will install latest version , incase specified will install given version.

here is the doc, list of angular version and its command..


I haven't tried this but personally I would try the accepted answer, but also do a complete npm uninstall of all packages before installing the v7.2.12 CLI, and do a full npm install after installing the v7.2.12 CLI

Tags:

Npm

Angular