更新AngularFire 5.0中的问题

时间:2017-10-04 05:37:02

标签: angularfire2

我正在使用Angular 2 app来存储用户在firebase中的购买详情。我正在使用AngularFire2与firebase进行交互。 该项目工作正常,直到我更新了angularfire2库。他们在github回购中提到他们在AngularFire 5.0进行了一些重大更改。 我尝试更新documentation中提到的函数调用。

我仍然收到以下错误。

  

我的package.json文件是:

{
  "name": "angular4-portal",
  "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/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5",
    "angularfire2": "^4.0.0-rc0",
    "core-js": "^2.4.1",
    "firebase": "^4.5.0",
    "ngx-bootstrap": "^2.0.0-beta.5",
    "rxjs": "^5.4.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "^1.4.4",
    "@angular/compiler-cli": "^4.2.4",
    "@angular/language-service": "^4.2.4",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.1.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.2.0",
    "tslint": "~5.3.2",
    "typescript": "^2.3.4"
  }
}

3 个答案:

答案 0 :(得分:0)

我有同样的问题,只是通过更新angularfire2来解决它。 你仍然是版本4.0.0.rc0(我是rc2)。 我已更新到最新版本5.0.0-rc.1,所有错误都消失了。

运行:

  

npm uninstall angularfire2

然后:

  

npm install angularfire2 --save

答案 1 :(得分:0)

我遇到了同样的问题并修复了app.module.ts IMPORTS。

你能告诉我你的app.module.ts档案吗?

答案 2 :(得分:0)

也许尝试降级到

“angularfire2”:“^ 4.0.0-rc.0”, “firebase”:“^ 3.9.0”

在package.json中的

- 这在我的项目中对我有用。