Typescript Error Cannot find name 'FirebaseService'

I’ve tried to install a new Ionic plugin (cordova-plugin-device, which I already had) and now I can’t serve or build my App. This is the error I get when I try to serve it. I haven’t changed anything, tried to update Node/Ionic/NPM packages, but still nothing helps at all.

Typescript Error
Cannot find name 'FirebaseService'.
node_modules/@firebase/database/dist/esm/src/api/Database.d.ts

This is my Ionic Info:

cli packages:

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.1.6
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

ios-deploy : 1.9.2 
ios-sim    : 5.0.12 
Node       : v8.9.3
npm        : 5.5.1 
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b

+1

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.7
    Cordova Platforms  : android 6.3.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.2
    Node       : v9.4.0
    npm        : 5.6.0
    OS         : macOS Sierra
    Xcode      : Xcode 9.2 Build version 9C40b

Don’t use Node 9. It isn’t compatible with Node Sass yet. Use the Node LTS. But the error is probably because you installed Firebase 4.8.1, and AF needs 4.8.0.