Angular应用中的警告:“在@ angular / core中找不到export eedefineInjectable”

时间:2019-11-28 02:14:31

标签: node.js angular npm version-control package

我已经尝试了关于stackoverflow的所有答案,但是仍然遇到相同的错误。

我试图删除node_modules,package-lock.json,然后进行npm安装。但是仍然出现相同的错误。

下面是我的package.json

{
  "name": "stadmin",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "serve": "ng serve",
    "servehmr": "ng serve --hmr",
    "start": "ng serve --port 8081",
    "devstart": "ng serve --host 0.0.0.0 --port 3031 --disable-host-check",
    "devstarthmr": "ng serve --hmr --configuration=hmr --host 0.0.0.0",
    "build": "ng build",
    "build_prod": "ng build --prod",
    "build_dev": "ng build --configuration=dev",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "generate": "ng generate @vicoders/generator:angular_component",
    "servelocal": "ng serve --port 4500 --configuration=local"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.0.0-beta.2",
    "@angular/animations": "^7.2.4",
    "@angular/common": "^7.2.4",
    "@angular/compiler": "^7.2.4",
    "@angular/core": "^7.2.4",
    "@angular/forms": "^7.2.4",
    "@angular/http": "^7.2.4",
    "@angular/platform-browser": "^7.2.4",
    "@angular/platform-browser-dynamic": "^7.2.4",
    "@angular/router": "^7.2.4",
    "@codersvn/ngx-sweetalert2": "^1.2.0",
    "@ng-select/ng-select": "^2.15.3",
    "@schematics/angular": "^0.7.3",
    "@tinymce/tinymce-angular": "^2.0.0",
    "@toverux/ngx-sweetalert2": "^4.0.0",
    "@vicoders/generator": "^1.0.37",
    "@vicoders/reactive-form": "^1.0.35",
    "angular2-chartjs": "^0.4.1",
    "angular2-text-mask": "^9.0.0",
    "animate.css": "^3.7.0",
    "bootstrap": "^4.0.0",
    "c3": "^0.4.21",
    "core-js": "^2.5.5",
    "css-animator": "^2.3.0",
    "d3": "^4.13.0",
    "famfamfam-flags": "^1.0.0",
    "font-awesome-scss": "^1.0.0",
    "hammerjs": "^2.0.8",
    "is-equal": "^1.5.5",
    "jquery": "^3.2.1",
    "js-cookie": "^2.2.0",
    "lodash": "^4.17.4",
    "moment": "^2.22.1",
    "ng-click-outside": "^3.2.0",
    "ng2-file-upload": "^1.3.0",
    "ng2-google-charts": "^3.4.0",
    "ng2-ui-switch": "^1.0.2",
    "ng2-validation": "^4.2.0",
    "ngx-bar-rating": "^1.1.0",
    "ngx-barcode": "^0.2.4",
    "ngx-chips": "^1.6.5",
    "ngx-color-picker": "^5.3.3",
    "ngx-perfect-scrollbar": "^5.3.5",
    "popper.js": "^1.14.3",
    "redux": "^3.7.2",
    "redux-logger": "^3.0.6",
    "redux-saga": "^1.0",
    "redux-subscriber": "^1.1.0",
    "redux-watch": "^1.1.1",
    "rxjs": "^6.4.0",
    "rxjs-compat": "^6.0.0-rc.0",
    "screenfull": "^3.3.2",
    "sweetalert2": "^7.13.3",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.6.8",
    "@angular/cli": "^7.3.9",
    "@angular/compiler-cli": "^7.2.4",
    "@angular/language-service": "^7.2.4",
    "@angularclass/hmr": "^2.1.3",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "^6.0.106",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "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": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~3.2.4"
  }
}

错误是:

./ node_modules/@agm/core/fesm5/agm-core.js中的警告 4538:120-128“在'@ angular / core'中未找到导出'ɵɵinject'

./ node_modules/@agm/core/fesm5/agm-core.js中的警告 4538:34-52“在'@ angular / core中未找到导出'ɵɵdefineInjectable'

请帮助谢谢。

2 个答案:

答案 0 :(得分:1)

只需删除ɵɵ注入的开始 ee ɵɵ defineInjectable

答案 1 :(得分:0)

angular和agm版本之间的此错误。切换到角度8或agm 1.0.0

https://github.com/SebastianM/angular-google-maps/issues/1787