Suresh Karia
Suresh Karia

Reputation: 18218

Unable to downgrade Angular from version 6 to 5

Recently (May 2018) newer stable version of angular has been released. I have migrated succesfully from version 5 to 6.

But for some reason I wanted to rollback to version 5. I have tried following commands:

npm uninstall -g @angular/cli

it uninstalled the latest version of angular-6.

npm cache clean --force

and then installed

npm install -g @angular/[email protected]

But it gave this error enter image description here

node version: 8.10.0

npm version: 6.0.0

Upvotes: 6

Views: 24018

Answers (4)

venkatesh p
venkatesh p

Reputation: 11

First run these three commands to check which version is installed currently:

node -v
npm -v
ng --version

Then to uninstall the cli:

npm uninstall -g @angular/cli 

To clean cache:

npm cache clean --force

Then install the version that you want (X.X.X):

npm install -g @angular/[email protected]

To check the successfull update:

ng --version

Upvotes: 1

Manohar Reddy Poreddy
Manohar Reddy Poreddy

Reputation: 27395

Same as the other answer, but this time only commands instead of a difficult to follow screenshot

I wanted to downgrade from 7.0.2 to 6.2.5

ng --version

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

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

Upvotes: 15

Matias Miraglio
Matias Miraglio

Reputation: 553

run

npm i npm@latest -g

to update node package manager. then run again

npm install -g @angular/[email protected]

Upvotes: 2

Mhyk Gyver
Mhyk Gyver

Reputation: 228

you have to update npm...please refer to screenshot...I've sucessfully downgraded angular 6 to angular 5... downgrade from angular 6 to angular 5

Upvotes: 10

Related Questions