Error on firebase ionic

[18:09:13] typescript: D:/radioencuentro/node_modules/@firebase/database/dist/esm/src/api/Database.d.ts, line: 4
Cannot find module ‘@firebase/app-types/private’.

   L3:  import { FirebaseApp } from '@firebase/app-types';
   L4:  import { FirebaseService } from '@firebase/app-types/private';

[18:09:13] typescript: …cuentro/node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts, line: 17
Cannot find module ‘@firebase/app-types/private’.

  L16:  getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData>;
  L17:  addTokenChangeListener(listener: (token: string | null) => void): void;
  L18:  removeTokenChangeListener(listener: (token: string | null) => void): void;

Error: Failed to transpile program
at BuildError.Error (native)
at new BuildError (D:\radioencuentro\node_modules@ionic\app-scripts\dist\util\errors.js:16:28)
at D:\radioencuentro\node_modules@ionic\app-scripts\dist\transpile.js:159:20
at transpileWorker (D:\radioencuentro\node_modules@ionic\app-scripts\dist\transpile.js:107:12)
at Object.transpile (D:\radioencuentro\node_modules@ionic\app-scripts\dist\transpile.js:64:12)
at D:\radioencuentro\node_modules@ionic\app-scripts\dist\build.js:109:82
[18:09:14] copy finished in 4.78 s


Hi, are you able to fix this issue.

i found this solution but its not working for ionic project

  1. Inside package.json, remove ^ from “firebase”: "^4.8.1"
    1.1 Downgrade Firebase from 4.8.1 to 4.8.0 by changing 4.8.1 to 4.8.0
    1.2 End result should look like this: “firebase”: “4.8.0”
  2. Run npm update in the Project Root. NPM will downgrade Firebase for ya
  3. Run ng serve --open to check for compilation errors. There shouldn’t be any.