如果我缺少任何相关信息,请告诉我。
我正在尝试构建一个使用adal-angular4进行Azure AD身份验证的Web应用程序。我遇到以下编译错误:
错误中的错误:模块C的元数据版本不匹配:/ Users / elmerm / source / repos / TxDOT POC Base / node_modules / adal-angular4 / index.d.ts,找到版本4,预期为3,在C中解析符号AppModule :/ Users / elmerm / source / repos / TxDOT POC Base / src / app / app.module.ts,在C:/ Users / elmerm / source / repos / TxDOT POC Base / src / app / app.module中解析符号AppModule .ts语法错误(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ angular \ compiler \ bundles \ compiler.umd.js:1729:34)在simpleInContext(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ angular \ compiler \ bundles \ compiler.umd.js:24979:23)在StaticReflector.simplify(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ angular \ compiler \ bundles \ compiler.umd.js:24991:13)在StaticReflector.annotations(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ angular \ compiler \ bundles \ compiler.umd.js:24418:41)在_getNgModuleMetadata(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ angular \ compiler-cli \ src \ ngtools_impl.js:138:31)在_extractLazyRoutesFromStaticModule(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ angular \ compiler-cli \ src \ ngtools_impl.js:109:26)在Object.listLazyRoutesOfModule(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ angular \ compiler-cli \ src \ ngtools_impl.js:53:22)在Function.NgTools_InternalApi_NG_2.listLazyRoutes(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ angular \ compiler-cli \ src \ ngtools_api.js:91:39)在AotPlugin._getLazyRoutesFromNgtools(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ ngtools \ webpack \ src \ plugin.js:240:66)在_donePromise.Promise.resolve.then.then.then.then(C:\ Users \ elmerm \ source \ repos \ TxDOT POC Base \ node_modules @ ngtools \ webpack \ src \ plugin.js:493:24)在process._tickCallback(内部/进程/next_tick.js:68:7)
查看adal-angular4(https://www.npmjs.com/package/adal-angular4)的npm页面时,它声明它与Angular 4+版本兼容。也许我误会了。我曾尝试使用旧版本的adal-angular4(v 3.0.6),但收到与上述完全相同的错误。
这是我的package.json:
{
"name": "inspinia",
"version": "2.7.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.0.1",
"@angular/common": "^4.0.1",
"@angular/compiler": "^4.0.1",
"@angular/compiler-cli": "^4.0.1",
"@angular/core": "^4.0.1",
"@angular/forms": "^4.0.1",
"@angular/http": "^4.0.1",
"@angular/platform-browser": "^4.0.1",
"@angular/platform-browser-dynamic": "^4.0.1",
"@angular/platform-server": "^4.0.1",
"@angular/router": "^4.0.1",
"@types/googlemaps": "^3.38.1",
"adal-angular": "^1.0.17",
"adal-angular4": "^4.0.12",
"animate.css": "3.1.1",
"bootstrap": "^3.3.7",
"chart.js": "^2.9.3",
"core-js": "^2.6.11",
"font-awesome": "^4.7.0",
"jquery": "^3.4.1",
"jquery-slimscroll": "^1.3.8",
"jquery-sparkline": "^2.4.0",
"jvectormap": "1.2.2",
"metismenu": "^2.5.0",
"ng2-charts": "^1.6.0",
"ngx-bootstrap": "^1.6.6",
"ngx-datetime-picker": "^2.3.0",
"ngx-select-dropdown": "^1.2.1",
"peity": "^3.2.1",
"rxjs": "^5.1.0",
"xml-js": "^1.6.11",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "^1.0.0",
"@angular/compiler-cli": "^2.4.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "^3.0.2",
"tslint": "~4.5.0",
"typescript": "^2.9.2"
}
}
这是否仅仅是兼容性问题,而当前的adal-angular4版本实际上与angular 4不兼容?还是我缺少简单的更新?
这是版本不匹配的问题。我将项目升级到了Angular(8)的最新版本,并能够继续进行。