【问题标题】:Ionic: Build failes when adding angularfirebase2 to app.module.ts fileIonic:将 angularfire base 2 添加到 app.module.ts 文件时构建失败
【发布时间】:2018-02-01 14:41:26
【问题描述】:

我正在努力使 angulafirebase2 在我的 Ionic 项目中工作。我只需按照 Ionic3 的安装/设置说明进行操作 here

当我在我的 app.module.ts 文件中添加 import { AngularFireModule } from 'angularfire2'; 并点击 ionic cordova build 时,我得到如下图所示的错误:

如果我注释掉 import angulafirebase2 的行,App build succeededed....

这是我的 package.json 文件:

  "dependencies": {
"@angular/animations": "^5.2.3",
"@angular/common": "^5.2.3",
"@angular/compiler": "^5.2.3",
"@angular/compiler-cli": "^5.2.3",
"@angular/core": "^5.2.3",
"@angular/forms": "^5.2.3",
"@angular/http": "^5.2.3",
"@angular/platform-browser": "^5.2.3",
"@angular/platform-browser-dynamic": "^5.2.3",
"@angular/platform-server": "^5.2.3",
"@angular/router": "^5.2.3",
"@angular/tsc-wrapped": "^4.4.6",
"@backand/angular2-sdk": "^1.2.13",
"@ionic-native/core": "^4.5.3",
"@ionic-native/geolocation": "^4.5.3",
"@ionic-native/google-maps": "^4.5.3",
"@ionic-native/photo-viewer": "^4.5.3",
"@ionic-native/splash-screen": "^4.5.3",
"@ionic-native/sqlite": "^4.5.3",
"@ionic-native/status-bar": "^4.5.3",
"@ionic/storage": "1.1.7",
"@types/googlemaps": "^3.30.5",
"angularfire2": "^5.0.0-rc.5-next",
"autoprefixer": "^7.2.5",
"com-sarriaroman-photoviewer": "^1.1.11",
"cordova-android": "^6.4.0",
"cordova-ios": "4.2.0",
"cordova-plugin-console": "1.0.5",
"cordova-plugin-device": "1.1.4",
"cordova-plugin-geolocation": "~2.4.3",
"cordova-plugin-googlemaps": "^2.2.2",
"cordova-plugin-inappbrowser": "~1.7.1",
"cordova-plugin-splashscreen": "~4.0.1",
"cordova-plugin-statusbar": "2.2.1",
"cordova-plugin-whitelist": "1.3.1",
"cordova-sqlite-storage": "^2.2.0",
"cordova-windows": "4.4.2",
"firebase": "^4.9.0",
"gulp": "^3.9.1",
"gulp-sass": "^3.1.0",
"ionic-angular": "2.0.1",
"ionic-native": "^2.9.0",
"ionic-plugin-keyboard": "~2.2.1",
"ionic2-numericpicker": "^1.3.0",
"ionicons": "3.0.0",
"jQuery": "^1.7.4",
"jquery": "^3.2.1",
"ngx-clipboard": "^9.1.3",
"promise-polyfill": "7.0.2",
"reflect-metadata": "^0.1.12",
"rxjs": "5.0.0-beta.12",
"save": "^2.3.2",
"sw-toolbox": "3.4.0",
"zone.js": "0.6.26"

}, “开发依赖”:{ "@angular/cli": "^1.6.7", "@ionic/app-scripts": "1.1.0", "@types/googlemaps": "^3.29.2", “打字稿”:“^2.7.1” },

【问题讨论】:

    标签: angular cordova firebase ionic3 angularfire2


    【解决方案1】:

    对于 Ionic(3 等),您应该注意您使用的打字稿版本。

    在您的 package.json 中将版本锁定为 2.4.2: “打字稿”:“2.4.2”

    并执行降级(修改package.json后通过npm update)

    请试试这个。应该可以解决您的问题。

    请参阅本指南以确保您的依赖项处于良好状态: https://forum.ionicframework.com/t/guide-how-to-update-to-ionic-3-x/87516

    我还在下面复制了我在其中一个应用程序中的开发依赖项:

    "devDependencies": {
    "@ionic/app-scripts": "^3.1.2",
    "ionic": "^3.19.0",
    "typescript": "2.4.2"
    

    },

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多