构建应用程序后Angular4不明异常

Angular4 unclear exception After building the application

我的应用程序使用 ng serve 运行良好,但是在使用 ng build --prod 构建它之后我得到了这个异常:

vendor.350ea18ab78ed7d28861.bundle.js:1 ERROR Error: No provider for e!
    at E (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at x (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at t._throwOrNull (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at t._getByKeyDefault (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at t._getByKey (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at t.get (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at Ue (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at t.get (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at Sn (vendor.350ea18ab78ed7d28861.bundle.js:1)
    at En (vendor.350ea18ab78ed7d28861.bundle.js:1)

问题是我找不到这个异常的来源,我不知道它是从哪里来的!

我正在使用 Angular 版本 4 和 ng CLI 版本 1.4.2,这是我的 package.json 文件:

"dependencies": {
    "@agm/core": "^1.0.0-beta.1",
    "@angular/animations": "^4.4.1",
    "@angular/common": "^4.4.1",
    "@angular/compiler": "^4.4.1",
    "@angular/core": "^4.4.1",
    "@angular/forms": "^4.4.1",
    "@angular/http": "^4.4.1",
    "@angular/platform-browser": "^4.4.1",
    "@angular/platform-browser-dynamic": "^4.4.1",
    "@angular/router": "^4.4.1",
    "core-js": "^2.5.1",
    "ngx-color-picker": "^4.5.0",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.17"
  },
  "devDependencies": {
    "@angular/cli": "^1.4.2",
    "@angular/compiler-cli": "^4.4.1",
    "@angular/language-service": "^4.4.1",
    "@types/jasmine": "^2.6.0",
    "@types/jasminewd2": "^2.0.3",
    "@types/node": "^6.0.88",
    "codelyzer": "~3.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "^1.7.1",
    "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"
  }

我该怎么办?

找到解决办法了,是版本问题
更新到4.4.3后一切正常
这是我现在的package.json:

{
  "name": "my-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": {
    "@agm/core": "^1.0.0-beta.1",
    "@angular/animations": "^4.4.3",
    "@angular/common": "^4.4.3",
    "@angular/compiler": "^4.4.3",
    "@angular/core": "^4.4.3",
    "@angular/forms": "^4.4.3",
    "@angular/http": "^4.4.3",
    "@angular/platform-browser": "^4.4.3",
    "@angular/platform-browser-dynamic": "^4.4.3",
    "@angular/router": "^4.4.3",
    "core-js": "^2.5.1",
    "ngx-color-picker": "^4.5.0",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.17"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.0",
    "@angular/compiler-cli": "^4.4.3",
    "@angular/language-service": "^4.4.3",
    "@types/jasmine": "^2.6.0",
    "@types/jasminewd2": "^2.0.3",
    "@types/node": "^6.0.88",
    "codelyzer": "~3.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "^1.7.1",
    "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.6.2",
    "webpack": "^3.10.0"
  }
}