Module not found: Can't resolve 'http2' when import firebase-admin

Viewed 1390

Im trying to add the firebase-admin to my ReactJS project but I got this error msg Module not found: Can't resolve 'http2', this is my code:

var admin = require("firebase-admin");

var serviceAccount = require("../firebase/aguia.json");

admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://guiacar-api.firebaseio.com"
});
console.log(admin);

aguia.json :

{
"type": "service_account",
"project_id": "*********",
"private_key_id": "******************************",
"private_key": "-----BEGIN PRIVATE  KEY-----\n********************\n-----END PRIVATE KEY-----\n",
"client_email": "**********",
"client_id": "**********",
"auth_uri": "**********",
"token_uri": "**********",
"auth_provider_x509_cert_url": "**********"

}

0 Answers
Related