0

Question... I'm on a system running Angular 5.x.x and need to upgrade it to 6.x.x. I found this posting: Want to upgrade project from Angular v5 to Angular v6

Wont Running the commands below upgrade to the latest versions and not 6?

ng update @angular/cli
ng update @angular/core
ng update @angular/material
ng update rxjs

So, in my scenario wouldn't I need to specify the version for them?

And, if I do then how do I know what version of rxjs I need to go to that works with the latest 6.x.x version?

Would this be my format for the calls to obtain whatever the latest version of 6 is?

ng update @angular/cli@^6.0.0
ng update @angular/core@^6.0.0
ng update @angular/material@^6.0.0
* Unsure what version of rxjs to specify

updates below...

Note: to get the .angular-cli.json migrated to angular.json run the command without the @version

ng update @angular/cli
edjm
  • 4,830
  • 7
  • 36
  • 65
  • This is kind of a weird question. You ask before you actually tried it? Why wouldn't you try first? :) – AT82 Sep 24 '19 at 12:23
  • https://stackoverflow.com/questions/48970553/want-to-upgrade-project-from-angular-v5-to-angular-v6 This may help you. – Surjeet Bhadauriya Sep 24 '19 at 12:24
  • @AJT82 believe it or not the system I'm working on is absolutely flaky. It is over a network and I have no less then a 10 second lag on every single action I take. Getting the system to it's current state has taken the last 2 hours. I'm terrified to make the attempt and have to try and roll things back and explain to management why after 4 hours things are no further along. – edjm Sep 24 '19 at 12:33
  • 1
    fair enough :) But yes, you need to specify the version you want to install, otherwise it will install the latest. EDIT: oh, and there is an answer already saying that, so my comment is obsolete :P – AT82 Sep 24 '19 at 12:43
  • If you have not yet updated your code to rxjs v6 syntax, then you may also have to install rxjs-compat, which will ensure compatibility for rxjs 5. Once the app is up and running you will have to remove this dependency before upgrading to next version. – sabithpocker Sep 24 '19 at 13:01
  • @Elijah Work on a different branch and environment, otherwise you are taking a huge risk. Make sure you have node,tsc, npm versions recommended by v6. Also, a lot of guides may be outdated as this upgrade was due a long time back. Also there is a script that can convert rxjs5 code to 6 which was effective for me. Personally, I took days to do the upgrade as a side project, 4 hours is okay. – sabithpocker Sep 24 '19 at 13:05
  • @sabithpocker I had followed the instructions calling for running the comand 'rxjs-5-to-6-migrate -p src/tsconfig.app.json'. But a question I have is the instructions also states to migrate any versionedFiles to the files array if you use the Angular Service worker. I don't know that that means ' Angular Service worker' can you tell me what I'm to look for ? – edjm Sep 24 '19 at 15:51
  • 1
    It is the modern way to cache resources on client side. If you dont use it you can ignore that. Read more [here](https://angular.io/guide/service-worker-intro) – sabithpocker Sep 25 '19 at 09:55

1 Answers1

2

yes you need to specify the version if you want to update to angular 6 where currently angular 8 is running.

For Rxjs: As you know, rxjs 6 supported for angular 6, so, you can use latest version with angular 6.

npm install rxjs@6.0.0
Md Rafee
  • 5,070
  • 3
  • 23
  • 32