我在项目中遇到此错误。 我看到有些图书馆不支持angular 4,我正在寻找在线资源,他们建议升级到angular5。
是否有可能在不升级到angular 5版本的情况下仍然能够使用该库。当我ng serve
发出此错误,而我尝试修改我的代码并保存时,该错误消失并且库正常工作。
模块的元数据版本不匹配错误 C:/Users/angular-4-sample-app/node_modules/highcharts-angular/highcharts-angular.d.ts,找到版本4,预期为3,在其中解析符号AppModule C:/Users/angular-4-sample-app/src/app/app.module.ts,解析符号 C:/Users/angular-4-sample-app/src/app/app.module.ts中的AppModule
{
"name": "angular-app",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"highcharts": "^7.0.3",
"highcharts-angular": "^2.4.0",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.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-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}