hy,当我用ng serve编译angular 4时出现错误:
模块/node_modules/ng2-img-max/dist/ng2-img-max.d.ts的元数据版本不匹配的错误,发现版本4,预期为3,在/ src / app / directives / directive中解析符号DirectiveModule .module.ts,解析/src/app/directives/directive.module.ts
中的符号DirectiveModule我的package.json:
{
"name": "ldp-front",
"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": {
"@agm/core": "^1.0.0-beta.2",
"@angular/animations": "^4.4.6",
"@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",
"@types/file-saver": "^1.3.0",
"angular2-tinymce": "^2.1.2",
"blueimp-canvas-to-blob": "^3.14.0",
"core-js": "^2.4.1",
"file-saver": "^1.3.3",
"moment": "^2.20.1",
"ng-recaptcha": "^3.0.3",
"ng2-img-max": "2.1.6",
"ng2-materialize": "^1.7.2",
"ngx-toastr": "^6.1.0",
"rxjs": "^5.4.1",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.2.7",
"@angular/compiler-cli": "^4.0.0",
"@angular/language-service": "^4.0.0",
"@types/googlemaps": "^3.30.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}
答案 0 :(得分:1)
转到node_modules / angular-2-dropdown-multiselect
并打开文件angular-2-dropdown-multiselect.metadata.json并将版本4更改为3