Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module '@firebase/app-types/private'

I have been working on angular and i wanted to use firebase for back end. I install angular fire following this instruction https://github.com/angular/angularfire2/blob/master/docs/install-and-setup.md here is my package.json

"angularfire2": "^5.0.0-rc.4",
"firebase": "^4.8.1",

I am facing this problem. Can anyone help me with this?

ERROR in node_modules/@firebase/database/dist/esm/src/api/Database.d.ts(4,33): error TS2307: Cannot find module '@firebase/app-types/private'.  node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts(17,39): error TS2307: Cannot find module '@firebase/app-types/private'.
like image 610
Solomon Avatar asked Dec 21 '17 14:12

Solomon


2 Answers

Change your firebase version back to 4.8.0. There was an issue in type definitions and its no longer work after updating from 4.8.0 to 4.8.1.

So change the version in the package.json file. remove the ^

"angularfire2": "^5.0.0-rc.4",
"firebase": "4.8.0",

Now execute the npm install command. This will install the 4.8.0 version

For further info refer this and this.

like image 97
Sachila Ranawaka Avatar answered Oct 08 '22 11:10

Sachila Ranawaka


There's a problem with the newest npm firebase package (v4.8.1).

To fix this problem, in your terminal. Type

npm uninstall --save firebase

Now, open your package.json file. There, you will find:

"angularfire2": "^5.0.0-rc.4",

Below this line, add a this line (Note, here is no Caret(^) symbol):

"firebase": "4.8.0",

After saving, hit npm install. Now, your application will work fine and smooth.

like image 13
abhijeetps Avatar answered Oct 08 '22 11:10

abhijeetps