Trouble Installing Angularfire2 with Ionic 4.1.1

Whenever I attempt to install angularfire2 using

npm install firebase angularfire2 --save

I get this long error code:

Computer:portfolioV2 computer$ npm install firebase angularfire2 --save
npm WARN @ionic/pro@2.0.3 requires a peer of cordova-plugin-ionic@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.12 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.12 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.12 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.12 requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.12 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.

+ angularfire2@5.0.0-rc.12
+ firebase@5.4.1
updated 2 packages and audited 3722 packages in 5.098s
found 0 vulnerabilities

It looks like it thinks my other installations are out of date? (like Cordova) but I’m pretty sure it is all the latest releases.
Ionic Info returns this

Ionic:

   ionic (Ionic CLI)  : 4.1.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   NodeJS : v10.9.0 (/usr/local/bin/node)
   npm    : 6.2.0
   OS     : macOS High Sierra
   Xcode  : Xcode 9.4.1 Build version 9F2000

Anyone else having this problem?

What does your package.json look like?

Your title is incorrect. The word error appears nowhere. Also, npm found 0 vulnerabilities.

I got rid of much of the errors through updates (so most of my package.json is up to date) except rxjs.
40%20PM

npm WARN @ionic-native/core@4.12.0 requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/splash-screen@4.12.0 requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/status-bar@4.12.0 requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.

You should probably revert rxjs to 5.5.11. There are several breaking changes from 5 to 6, and ionic-native might need 5. And unless you’re doing heavy lifting with Observables, it won’t make any difference to your own code.

The only issue with that is that angular requires rxjs 6.0.0 or higher. Should I just revert all my angular version back to 5.x?

No, there were breaking changes from 5 to 6, including in the build process. I didn’t put two and two together, sorry. I think Ionic/native will have to catch up, as part of the Ionic 4 release. Unless they want everyone to move to capacitor?

Ok I think that’s the case. I have almost all the code working except for two ionic-native plugins for statusBar and splashScreen. Until native works I guess I just have to take that out.

Hi there,

There is a special article from Jorge Vergara about this issue.
I got the same error, and I solve that with this simple way:

Keep RXJS in 6
and install RXJS compat

npm i rxjs-compat

Have fun!!! :grinning:

1 Like

Thanks for the fix! Now that rxjs is compatible it all works great