-2

I'm trying to create an angular 5.2.6 app. But, when i use ng new my-app, the angular version is 5.2.0.

So : how to upgrade my app to 5.2.6 ? I didn't find a migration guide in angular's website...

Thanx for your help !

  • 1
    Possible duplicate of [How to upgrade Angular CLI to the latest version](https://stackoverflow.com/questions/43931986/how-to-upgrade-angular-cli-to-the-latest-version) – Daniel Beck Feb 24 '18 at 16:47
  • 1
    Possible duplicate of [How do I update each dependency in package.json to the latest version?](https://stackoverflow.com/questions/16073603/how-do-i-update-each-dependency-in-package-json-to-the-latest-version) – Jota.Toledo Feb 24 '18 at 16:48
  • @DanielBeck Is not a problem with Angular CLI. My cli is already updated – user1767541 Feb 24 '18 at 22:08
  • @Jota.Toledo I know how to update a package with editing package.json. I would like know the good practice to update Angular :) – user1767541 Feb 24 '18 at 22:10

1 Answers1

0

1.In your package.json file, edit dependencies so it is like:

"dependencies": {
    "@angular/animations": "^5.2.6",
    "@angular/common": "^5.2.6",
    "@angular/compiler": "^5.2.6",
    "@angular/core": "^5.2.6",
    "@angular/forms": "^5.2.6",
    "@angular/http": "^5.2.6",
    "@angular/platform-browser": "^5.2.6",
    "@angular/platform-browser-dynamic": "^5.2.6",
    "@angular/router": "^5.2.6",
    "core-js": "^2.5.3",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },

2.Save your file and delete node_modules folder manualy or remove node_modules by using: rm -rf node_modules dist or use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell

3.Now try:

npm install
Joe Belladonna
  • 1,349
  • 14
  • 20