如何从 Adal 4 升级到 Adal5?

How to upgrade from Adal 4 to Adal5?

您好,我正在研究 angular 5。我正在使用 adal 4 身份验证。我正在尝试将其升级到 adal 4 到 adal 5。

下面是我的package.json.

"dependencies": {
    "@angular/animations": "^5.1.0",
    "@angular/common": "5.1.0",
    "@angular/compiler": "5.1.0",
    "@angular/compiler-cli": "5.1.0",
    "@angular/core": "5.1.0",
    "@angular/forms": "5.1.0",
    "@angular/platform-browser": "5.1.0",
    "@angular/platform-browser-dynamic": "5.1.0",
    "@angular/platform-server": "5.1.0",
    "@angular/router": "5.1.0",
    "@ngtools/webpack": "1.9.3",
    "@ngx-translate/core": "9.0.1",
    "@swimlane/ngx-datatable": "11.1.5",
    "@types/jquery": "3.2.16",
    "@types/webpack-env": "1.13.3",
    "adal-angular4": "^1.1.10",
    "angular-material-autocomplete-list": "^1.1.0",
    "angular2-multiselect-checkbox-dropdown": "^1.5.0",
    "angular2-template-loader": "0.6.2",
    "aspnet-webpack": "2.0.1",
    "awesome-typescript-loader": "3.4.1",
    "bootstrap": "3.3.7",
    "bootstrap-datepicker": "1.7.1",
    "bootstrap-select": "1.12.4",
    "bootstrap-toggle": "2.2.2",
    "bootstrap-vertical-tabs": "1.2.2",
    "chart.js": "2.7.1",
    "core-js": "2.5.3",
    "css": "2.2.1",
    "css-loader": "0.28.7",
    "enhanced-resolve": "^3.3.0",
    "event-source-polyfill": "0.0.12",
    "expose-loader": "0.7.4",
    "extract-text-webpack-plugin": "3.0.2",
    "file-loader": "1.1.5",
    "font-awesome": "4.7.0",
    "html-loader": "0.5.1",
    "jquery": "3.2.1",
    "json-loader": "0.5.7",
    "materialize-css": "^0.100.2",
    "ng2-charts": "1.6.0",
    "ng2-dropdown": "0.0.21",
    "ng2-toasty": "4.0.3",
    "ngx-bootstrap": "2.0.0-beta.11",
    "ngx-toggle-switch": "^1.3.9",
    "node-sass": "4.7.2",
    "primeng": "^5.2.0-rc.1",
    "raw-loader": "0.5.1",
    "rxjs": "5.5.5",
    "sass-loader": "6.0.6",
    "style-loader": "0.19.0",
    "to-string-loader": "1.1.5",
    "typescript": "2.6.2",
    "url-loader": "0.6.2",
    "web-animations-js": "2.3.1",
    "webpack": "3.10.0",
    "webpack-hot-middleware": "2.21.0",
    "webpack-merge": "4.1.1",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.4",
    "@types/chai": "4.0.10",
    "@types/jasmine": "2.8.2",
    "chai": "4.1.2",
    "jasmine-core": "2.8.0",
    "karma": "1.7.1",
    "karma-chai": "0.1.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "1.0.1",
    "karma-jasmine": "1.1.1",
    "karma-jasmine-html-reporter": "0.2.2",
    "karma-webpack": "2.0.6"
  }

我尝试了以下方法,

从 package.json 中删除了 "adal-angular4": "^1.1.10" 并且我尝试安装 npm install adal-angular5。这导致错误 1235 错误请再次尝试 运行 此命令作为 root/Administrator。我 运行 只是管理员。 有人可以帮我升级到 adal 5 吗?

抱歉,不知道为什么会出现错误。但是,adal-angular5 是一个不同的 NPM,您可以尝试将 adal-angular4 NPM 更新到现在支持 Angular5 的 2.0.0:

Updated to Angular 5, cleaned up files. THIS IS A BREAKING VERSION!