Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to downgrade to Angular 7 from Angular 8 or 9

Tags:

npm

angular

So I was trying to upgrade our entire web-application earlier from Angular 6 to 7. And I was able to do that since the script I run earlier installed the most latest version available of Angular which is Angular 8 (should have been 7 though as I thought) release 2 days ago. But it turns out there are build issues in the node modules when I did the upgrade to Angular 8. So instead, I want to downgrade my project from Angular 8 to Angular 7. How do I do that?. TIA.

PS: I did not expect that there is Angular 8 alright, so I thought it would install Angular 7 as the latest version.

like image 601
iamjoshua Avatar asked May 30 '19 13:05

iamjoshua


People also ask

How do I migrate from Angular 7 to 9?

You can optionally pass the --create-commits (or -C ) flag to ng update commands to create a git commit per individual migration. Run NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@9 update @angular/core@9 @angular/cli@9 which should bring you to version 9 of Angular.

How do I migrate from Angularjs 7 to 10?

Run npx @angular/cli@10 update @angular/core@10 @angular/cli@10 which should bring you to version 10 of Angular. New projects use the filename . browserslistrc instead of browserslist . ng update will migrate you automatically.


2 Answers

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]
like image 99
Abderrahim Soubai-Elidrisi Avatar answered Sep 30 '22 19:09

Abderrahim Soubai-Elidrisi


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..

like image 31
Mohideen bin Mohammed Avatar answered Sep 30 '22 19:09

Mohideen bin Mohammed