Unable to downgrade Angular from version 6 to 5
Asked Answered
S

4

6

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

Secco answered 10/5, 2018 at 8:4 Comment(5)
Try and see if updating to the most recent release of npm solves the issue: npm install -g npm@latestFairlead
npm version please, you have mentioned your node version. what does npm -v shows?Subjoinder
@Subjoinder check last line of questionSecco
@eirenaios the latest version of npm is v6.0.1 how could you it be 8.10.0 it's your node version you npm version must be 5.6.0Subjoinder
@Subjoinder ooops right, npm version is 6.0.0Secco
M
10

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

Merlinmerlina answered 12/5, 2018 at 12:53 Comment(1)
thanks it would be great if you write down all the commands that will help other users easily followupSecco
G
15

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
Guardafui answered 30/10, 2018 at 13:10 Comment(0)
M
10

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

Merlinmerlina answered 12/5, 2018 at 12:53 Comment(1)
thanks it would be great if you write down all the commands that will help other users easily followupSecco
N
2

run

npm i npm@latest -g

to update node package manager. then run again

npm install -g @angular/[email protected]

Nomanomad answered 18/5, 2018 at 20:31 Comment(1)
I have problem with this either installing 1.7.4 or 6.2.5 it stays with angular 7.2.6. node:v8.11.3 npm:6.8.0. I am trying to downgrade angular7 to 6 but without success.Statehood
V
1

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
Vale answered 12/8, 2019 at 11:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.