Nikolas Soares
Nikolas Soares

Reputation: 489

How to update angular project version 5 for version 7

my project is currently at version 5.2 and would like to upgrade to angular version 7.2.15, how to do it the easiest and fastest way, follow my dependencies package.json

"dependencies": {
    "@agm/core": "^1.0.0-beta.3",
    "@angular/animations": "^5.2.9",
    "@angular/common": "^5.2.9",
    "@angular/compiler": "^5.2.9",
    "@angular/core": "^5.2.9",
    "@angular/forms": "^5.2.9",
    "@angular/http": "^5.2.9",
    "@angular/platform-browser": "^5.2.9",
    "@angular/platform-browser-dynamic": "^5.2.9",
    "@angular/platform-server": "^5.0.0",
    "@angular/router": "^5.2.9",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0",
    "@types/google-maps": "^3.2.0",
    "@types/icheck": "^0.8.29",
    "@types/jqueryui": "^1.11.35",
    "angular2-jwt": "^0.2.3",
    "animate.css": "^3.7.0",
    "bootstrap": "^3.3.7",
    "core-js": "^2.6.3",
    "font-awesome": "^4.7.0",
    "icheck": "^1.0.2",
    "install": "^0.10.1",
    "jquery": "^3.3.1",
    "jqueryui": "^1.11.1",
    "jspdf": "^1.4.1",
    "moment": "^2.24.0",
    "morgan": "^1.9.1",
    "multer": "^1.3.0",
    "ng2-currency-mask": "^4.4.1",
    "ng2-dragula": "^2.1.1",
    "ng2-file-upload": "^1.3.0",
    "ng2-google-charts": "^3.4.0",
    "ng2-lazy-trumbowyg": "^2.4.2",
    "ng2-pdf-viewer": "^4.0.0",
    "ng2-toasty": "^4.0.3",
    "ngx-captcha": "^5.0.4",
    "ngx-image-cropper": "^1.4.1",
    "ngx-mask": "^6.3.8",
    "ngx-pagination": "^3.1.1",
    "ngx-popover": "0.0.16",
    "ngx-progressbar": "^2.1.1",
    "ngx-uploader": "^7.1.0",
    "npm": "^6.10.2",
    "primeng": "^5.2.3",
    "quill": "^1.3.4",
    "rxjs": "^5.5.12",
    "trumbowyg": "^2.15.2",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.12.3",
    "@angular/cli": "^7.2.3",
    "@angular/compiler-cli": "^5.2.9",
    "@angular/language-service": "^5.2.11",
    "@types/googlemaps": "^3.30.10",
    "@types/jasmine": "~2.6.0",
    "@types/jasminewd2": "~2.0.2",
    "@types/jquery": "^2.0.47",
    "@types/jspdf": "^1.2.1",
    "@types/morris.js": "^0.5.6",
    "@types/node": "~6.0.60",
    "codelyzer": "~4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^3.1.1",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.3.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.1",
    "ts-node": "~3.3.0",
    "tslint": "~5.7.0",
    "typescript": "~2.4.2"
  }

You can see that is with angular 5 and some dependencies with ng2 -... but this I think you can update the library of each one quietly

I just want to know what I may be changing from the angle to upgrade to version 7.2.15, because I think this is the best time not to break the dependencies too much

Upvotes: 0

Views: 303

Answers (2)

Anna
Anna

Reputation: 3256

You will need to follow the angular guide to update from 5 to 7. Unfortunately there is no easy way to update all packages at once. In CLI you can use ng update --packages <list of packages separated by space>

Take a look at ng update. However some ng2-... packages from your package.json still may need your attention, as they weren't update for year or two. Hopefully they will support angular 7, but be prepared to replace them with other packages if not.

Upvotes: 1

amshu
amshu

Reputation: 149

Use the official website's guide: https://update.angular.io/

Tip: Make sure you update from 5 to 6 and then to 7. Updating from 5 to 7 directly is highly not recommended.

Upvotes: 0

Related Questions