Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Universal Update from v7 to v8

I have recently updated my project from angular 7 to 8 with ng update. All work fine but i figured out that Angular Universal is not updated to version 8.

When i check my ng update i have this line

ng update @nguniversal/aspnetcore-engine

But that following error when i try to update :

Package '@nguniversal/aspnetcore-engine' is not a dependency.

Angular Universal is not updated and Here my package.json. How can i update Angular Universal and why it's not possible with ng update.

"dependencies": {
    "@angular/animations": "^8.2.14",
    "@angular/cdk": "^8.2.3",
    "@angular/common": "^8.2.14",
    "@angular/compiler": "^8.2.14",
    "@angular/core": "^8.2.14",
    "@angular/forms": "^8.2.14",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "^8.2.14",
    "@angular/platform-browser-dynamic": "^8.2.14",
    "@angular/platform-server": "^8.2.14",
    "@angular/pwa": "~0.803.23",
    "@angular/router": "^8.2.14",
    "@angular/service-worker": "8.2.14",
    "@ngrx/effects": "8.6.0",
    "@ngrx/entity": "8.6.0",
    "@ngrx/router-store": "8.6.0",
    "@ngrx/store": "^8.6.0",
    "@ngrx/store-devtools": "8.6.0",
    "@nguniversal/common": "^7.1.1",
    "@nguniversal/express-engine": "^7.1.1",
    "@nguniversal/module-map-ngfactory-loader": "^7.1.1",
    "@taoqf/javascript-state-machine": "^3.0.8",
    "angular7-csv": "^0.2.12",
    "bootstrap": "^4.3.1",
    "chart.js": "^2.8.0",
    "core-js": "^2.6.10",
    "flag-icon-css": "^3.4.2",
    "font-awesome": "^4.7.0",
    "ng2-file-upload": "^1.2.0",
    "ngx-captcha": "^6.4.0",
    "ngx-cookie": "^4.1.2",
    "ngx-infinite-scroll": "^7.2.0",
    "primeicons": "^2.0.0",
    "primeng": "^7.1.3",
    "rxjs": "^6.5.4",
    "ts-helpers": "^1.1.1",
    "tslib": "^1.10.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.23",
    "@angular/cli": "~8.3.23",
    "@angular/compiler-cli": "^8.2.14",
    "@angular/language-service": "^8.2.14",
    "@ngrx/schematics": "^8.6.0",
    "@types/google.analytics": "0.0.39",
    "@types/jasmine": "3.3.8",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.1",
    "jasmine-core": "~3.3.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.4.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^2.1.0",
    "karma-jasmine": "2.0.1",
    "karma-jasmine-html-reporter": "1.4.0",
    "protractor": "~5.4.1",
    "rxjs-tslint": "^0.1.7",
    "ts-loader": "^4.5.0",
    "ts-node": "^7.0.1",
    "tslint": "~5.11.0",
    "typescript": "~3.5.3",
    "webdriver-manager": "12.1.1",
    "webpack-cli": "^3.3.9"
  }

Hope someone can help me.

Thank you

like image 208
Spawnrad Avatar asked Jan 30 '20 11:01

Spawnrad


People also ask

How do I upgrade from Angular 7 to 8?

ng update should take care of this automatically. Learn more on angular.io. Make sure you are using Node 10.13 or later. Run NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@8 update @angular/core@8 @angular/cli@8 in your workspace directory to update to the latest 8.

How can I update my Angular project from 7 to 11?

You can run ng add @angular/localize to include required packages. Finally, run ng update @angular/core @angular/cli command to update to Angular 11. This will migrate your project to latest Angular release. After the update to Angular 11 is done your project will be using Typescript 4.

How do I upgrade from Angular 7 to Angular 12?

Run ng update @angular/core@12 @angular/cli@12 which should bring you to version 12 of Angular. Angular now requires TypeScript 4.2. ng update will update you automatically.

How do I update all Angular libraries to the latest version?

Just update @angular/core and @angular/cli by using ng update command. If you are using Angular material You have to update it as well using ng update command. The Angular latest Official stable version is Angular v14 which is released on 2nd June 2022. The Angular latest Official stable version is Angular v13.


1 Answers

I just ran into the same issue while upgrading to Angular 9 from Angular 8, I fixed it by upgrading the package that was using it.

Have a look at the nguniversal packages in the dependencies

"@nguniversal/common": "^7.1.1",
"@nguniversal/express-engine": "^7.1.1",
"@nguniversal/module-map-ngfactory-loader": "^7.1.1",

Try upgrading @nguniversal/module-map-ngfactory-loader (ng update @nguniversal/module-map-ngfactory-loader).

like image 176
devpro Avatar answered Oct 04 '22 09:10

devpro