简体   繁体   中英

How to upgrade Angular2 application to Angular4 application while updating through command it is upgrading it into angular 5.2.9

I have updated my angular2 application by using following command for update it.

 npm install @angular/{common,compiler,compiler-
 cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-
 server,router,animations}@latest typescript@latest --save

this command have updated my angular2 application to angular 5.2.9 which is latest version but i want to update it to most stable angular version , which is I think angular4 . so what should be change in the command.

and also my d3 dependencies not working properly after up gradation.

If you want to install a specific version all you have to do is target that version such as npm install @angular/cdk@4.0.0 . In your case

npm install @angular/{common,compiler,compiler-
 cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-
 server,router,animations}@4.0.0

Although, I don't understand why you believe Angular v4 is more stable than Angular v5. Angular v5 is stable and by choosing to target a lower version you may end up using API's that are deprecated in later versions (in this case v5). I would recommend staying with Angular v5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM