Ionic 3项目中的Firebase

时间:2017-12-20 00:08:39

标签: firebase ionic3 angular5

当我尝试使用ionic serveionic cordova run android --device运行离子项目时,会出现以下错误:

  

typescript:node_modules/@firebase/database/dist/esm/src/api/Database.d.ts,line:4   
找不到模块'@ firebase / app-types / private'。

我不知道为什么会这样。另外,我最近升级到Angular 5,不知道是否有事可做。
这是我的package.json

 "dependencies": {
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/flex-layout": "2.0.0-beta.12",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "@ionic-native/admob-free": "^4.5.2",
    "@ionic-native/camera": "^4.5.2",
    "@ionic-native/core": "^4.5.2",
    "@ionic-native/facebook": "^4.5.2",
    "@ionic-native/fcm": "^4.5.2",
    "@ionic-native/file": "^4.5.2",
    "@ionic-native/file-transfer": "^4.5.2",
    "@ionic-native/geolocation": "^4.5.2",
    "@ionic-native/google-maps": "^4.5.2",
    "@ionic-native/network": "^4.5.2",
    "@ionic-native/splash-screen": "^4.5.2",
    "@ionic-native/status-bar": "^4.5.2",
    "@ionic/storage": "^2.0.1",
    "@ngx-translate/core": "9.0.1",
    "@ngx-translate/http-loader": "2.0.0",
    "@types/google-maps": "^3.2.0",
    "@types/googlemaps": "3.30.0",
    "codelyzer": "^4.0.2",
    "cordova-admob-sdk": "^0.11.1",
    "cordova-android": "^6.4.0",
    "cordova-plugin-add-swift-support": "1.7.0",
    "cordova-plugin-admob-free": "^0.11.0",
    "cordova-plugin-browsertab": "^0.2.0",
    "cordova-plugin-buildinfo": "^1.1.0",
    "cordova-plugin-camera": "^2.4.1",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-customurlscheme": "^4.3.0",
    "cordova-plugin-device": "^1.1.7",
    "cordova-plugin-facebook4": "^1.9.1",
    "cordova-plugin-fcm": "^2.1.2",
    "cordova-plugin-file": "^4.3.3",
    "cordova-plugin-file-transfer": "^1.6.3",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-googlemaps": "^2.1.1",
    "cordova-plugin-nativestorage": "^2.2.2",
    "cordova-plugin-network-information": "^1.3.4",
    "cordova-plugin-splashscreen": "^4.1.0",
    "cordova-plugin-statusbar": "^2.3.0",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-promise-polyfill": "0.0.2",
    "cordova-universal-links-plugin": "^1.2.1",
    "firebase": "^4.6.0",
    "ionic-angular": "3.9.2",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "rxjs": "^5.5.5",
    "sw-toolbox": "3.6.0",
    "tslint": "~5.7.0",
    "typescript": "~2.4.2",
    "zone.js": "0.8.18"
  },


  "devDependencies": {
    "@angular/cli": "^1.6.1",
    "@angular/compiler-cli": "^5.0.3",
    "@ionic/app-scripts": "3.1.5",
    "@ngtools/webpack": "^1.1.2",
    "@types/jasmine": "2.8.2",
    "@types/node": "8.0.57",
    "codecov": "^1.0.1",
    "codelyzer": "^4.0.1",
    "connect": "3.6.0",
    "jasmine": "^2.8.0",
    "jasmine-core": "^2.8.0",
    "jasmine-spec-reporter": "^3.2.0",
    "karma": "^1.7.1",
    "karma-chrome-launcher": "^2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.3.0",
    "karma-jasmine": "^1.0.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-mocha-reporter": "^2.2.4",
    "karma-remap-istanbul": "^0.4.0",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.7.0",
    "tslint-eslint-rules": "4.1.1",
    "typescript": "^2.4.2"
  },

提前致谢

1 个答案:

答案 0 :(得分:2)

我认为这个错误是由于最近的firebase软件包发布(4.8.1),他们重构了打字设置。强制firebase软件包到版本4.8.0应解决您的问题。