Firebase firestore not working with Angular Universal: package.json does not exist

I followed this tutorial for creating server side rendered app. After that I run npm install firebase @angular/fire --save and import the modules in the AppModule like this

import { AngularFireModule } from "@angular/fire";
import { AngularFirestoreModule } from "@angular/fire/firestore";
import { AngularFireStorageModule } from "@angular/fire/storage";

 AngularFireModule.initializeApp(environment.firebase),
 AngularFirestoreModule,
 AngularFireStorageModule,

The error occurs when I try to serve the app using npm run build:ssr && npm run serve:ssr. The error I get is

C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:159431
        throw new Error("package.json does not exist at " + package_json_path);
        ^
Error: package.json does not exist at C:\Users\user\Documents\prueba\PruebaApp\dist\package.json
    at Object.PsoT.exports.find (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:159431:15)
    at Object.wPNL (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:188373:12)
    at __webpack_require__ (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:20:30)
    at Object.XpdW (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:166719:12)
    at __webpack_require__ (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:20:30)
    at Object.g1pB (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:175163:27)
    at __webpack_require__ (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:20:30)
    at Object.Ou8q (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:156910:14)
    at __webpack_require__ (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:20:30)
    at Object.BYZf (C:\Users\user\Documents\prueba\PruebaApp\dist\server\main.js:21357:12)

If I remove the AngularFirestoreModule the project build and work properly.

Im using Angular 8.1.1 , firebase 6.3.0 and angular/fire 5.2.1