Ad

Cannot Find Module 'firebase/app' In Version 5.7.0

I'm trying to build an angular project to be deployed on Firebase, but I can't run my npm run build or even npm start commands due to the following error.

ERROR in node_modules/@angular/fire/database/interfaces.d.ts(2,26): error TS2307: Cannot find module 'firebase/app'. node_modules/@angular/fire/firebase.app.module.d.ts(2,79): error TS2307: Cannot find module 'firebase/app'.

I've gone through past questions, and have cleared my node_modules folder, as well as package-lock.json file, and reinstalled all the dependencies. I still keep getting this error.

Here's what I'm using in my app:

"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"angularfire2": "^5.1.1",
"bootstrap": "^4.1.3",
"core-js": "^2.4.1",
"firebase": "^5.7.0",
"jquery": "^3.3.1",
"particles.js": "^2.0.0",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"

Can someone please help me with this. Thank you in advance.

Cheers!

Ad

Answer

Maybe try to use angularFire2 which seems to be the angular firebase lib ;-)

angularfire2 @ github

angularfire2 @ npm

This firebase issue seems to be the same.

Additional this angularFire2 Stackblitz demo is working for me.

Edit:

Last but not least you might update your angular version (try to you use angular6 or 7).

Quote from the firebase issue:

Also I noticed you are on Angular 5. Would you be able to upgrade to angular6 or 7 and use the new cli to see if the problem persist? AngularFire project doesn't seem to have this problem and they are on angular6: https://github.com/angular/angularfire2

Ad
source: stackoverflow.com
Ad