ctorParameters.map不是一个函数--AngularFire2

时间:2017-02-09 21:39:56

标签: javascript angular firebase angularfire2

我正在尝试将Firebase与Angular 2一起使用,以获取某个人的位置并将其显示在Google地图上。而且每隔一段时间,这个职位必须实时改变。

我的package.json:

{
  "name": "App",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~2.1.0",
    "@angular/compiler": "~2.1.0",
    "@angular/core": "~2.1.2",
    "@angular/forms": "~2.1.0",
    "@angular/http": "~2.1.2",
    "@angular/platform-browser": "~2.1.0",
    "@angular/platform-browser-dynamic": "~2.1.0",
    "@angular/router": "~3.1.2",
    "angularfire2": "^2.0.0-beta.7",
    "core-js": "^2.4.1",
    "firebase": "^3.6.9",
    "gentelella": "^1.3.0",
    "rxjs": "5.0.1",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@types/jasmine": "^2.2.30",
    "@types/node": "^6.0.42",
    "angular-cli": "1.0.0-beta.28-3",
    "bootstrap": "^3.3.6",
    "codelyzer": "1.0.0-beta.1",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.9",
    "rxjs": "^5.1.0",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "~2.0.3",
    "webdriver-manager": "10.2.5"
  }
}

我运行npm update,然后npm uninstall -g angular-clinpm cache clearnpm install -g angular-cli@lastest,但它对我不起作用。当我在AngularFireModule中激活app.module.ts时,它会给出错误:

Reflection_capabilities.js: 58 -> Uncaught TypeError: ctorParameters.map is not a function (...)

这是我的app.module文件:

[..]
import { AngularFireModule } from 'angularfire2';
[..]

export const firebaseConfig = {
 apiKey: "...",
 authDomain: "abc.firebaseapp.com",
 databaseURL: "https://abc.firebaseio.com",
 storageBucket: "abc.appspot.com",
 messagingSenderId: "48515646ABC"
};

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    AngularFireModule.initializeApp(firebaseConfig),
    RouterModule.forRoot(routes)
  ],
  providers: [
    ...
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

我做错了什么?我应该更新什么?当我运行npm update时,我没有收到任何消息。

0 个答案:

没有答案