Zum Inhalt springen

Update Oidc App from Angular 12 to 13

Package version of major components berfore upgrade

  • angular-auth-oidc-client@12.0.2
  • @angular/core@12.1.3
  • @angular/cli@12.1.3
  • rxjs@6.6.7
  • typescript@4.3.5

Get the update command from angular.io

  • Goto https://update.angular.io/
  • Fill out: From:12.0 / To:13.0 version field
  • Click on: Show how to update
  • Extract Angular Update command: npx @angular/cli@13 update @angular/core@13 @angular/cli@13

Clone an Angular 12 Oidc project and run npm

D:\dev\Quarkus> git clone https://git.informatik.fh-nuernberg.de/HutzlerHe/oidc-autologin-angular-12

D:\dev\Quarkus>cd oidc-autologin-angular-12

D:\dev\Quarkus\oidc-autologin-angular-12> npm install

Validate the current npm version and unistall oidc client lib

  • angular-auth-oidc-client@12.0.2
  • @angular/cli@12.1.3
  • @angular/core@12.1.3
  • Uninstal current Oidc 12.0.2 Lib: # npm uninstall angular-auth-oidc-client -force
  • Commit these changes
D:\dev\Quarkus\oidc-autologin-angular-12>git add  package.json package-lock.json package.json

D:\dev\Quarkus\oidc-autologin-angular-12>git commit -m "After deinstal if OIDC LIB"
[master a60e425] After deinstal if OIDC LIB
 2 files changed, 142 insertions(+), 343 deletions(-)

Run Angular upgrade Command

  • # npx @angular/cli@13 update @angular/core@13 @angular/cli@13
  • Fails wiht error
  • Run: # npx ng update @angular-eslint/schematics –next
  • Install Oidc lib : # npm install angular-auth-oidc-client
  • Validate Npm module version: # npm list –depth 0

Fix outdated packages

  • Locate outdated packages # npm outdated –depth 0
  • Run npm to fix it
# npm install rxjs@latest ts-node@latest @types/node@latest @types/jasmine@latest
# npm install eslint@latest  ts-node@latest karma@latest
# npm install @angular-eslint/builder@latest  @angular-eslint/schematics@latest @angular-eslint/template-parser@latest
# npm install @angular-eslint/eslint-plugin@latest @angular-eslint/eslint-plugin-template@latest
# npm install @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest
# npm install @types/node@latest ts-node@latest
# npm install jasmine-core@latest jasmine-spec-reporter@latest karma-coverage@latest

Validate package state

Package version of major components after upgrade

  • angular-auth-oidc-client@13.1.0
  • @angular/core@13.2.1
  • @angular/cli@13.2.2
  • rxjs@7.5.2
  • typescript@4.5.5
Published inAllgemein

Sei der Erste der einen Kommentar abgibt

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert