Currently encountering an issue while trying to integrate firebase-admin into my angular project. Despite my efforts, I am unable to resolve the error that keeps popping up (refer to the screenshot below).
https://i.stack.imgur.com/kdCoo.png
I attempted npm install google-cloud
, but unfortunately, it only led to more errors. As someone transitioning from Android development, navigating through this issue on my own has been challenging. It seems like there's a missing piece in the puzzle, and I am unsure of what exactly it is.
This is an excerpt from my app.component.ts
:
import {Component} from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
constructor() {
const admin = require('firebase-admin');
const serviceAccount =
require("C:/Users/Pawel/Desktop/CODE/pamiAdmin3/src/app/serviceKey.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: 'https://pami-16c0f.firebaseio.com'
});
}
}