模块ng2-img-tools的元数据版本不匹配错误

时间:2018-01-08 19:44:36

标签: angular npm angular-cli

我正在尝试使用Angular4的ng2-img-tools包并遇到此错误:

ERROR in Metadata version mismatch for module ~/client/node_modules/ng2-img-tools/dist/ng2-img-tools.d.ts, found version 4, expected 3, resolving symbol AppModule in ~/client/src/app/app.module.ts, resolving symbol AppModule in ~/client/src/app/app.module.ts

我通过尝试所说的包的每个版本来强制强制..但仍然遇到上面的错误..任何帮助?

这是我的package.json

{
  "name": "project",
  "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",
    "angular2-flash-messages": "1.0.8",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "moment": "^2.18.1",
    "ng2-dnd": "^2.2.2",
    "ng2-img-tools": "^1.1.3",
    "ng2-select": "^1.2.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"
  }
}

1 个答案:

答案 0 :(得分:0)

Appmodule import change row

从'ng2-img-tools'导入{Ng2ImgToolsModule}; //删除行

从“ng2-img-tools / dist / src / ng2-img-tools.module”导入{Ng2ImgToolsModule}; //添加行