找不到模块:导入firebase-admin时无法解析“ http2”

时间:2019-01-05 18:12:52

标签: reactjs firebase firebase-realtime-database firebase-authentication

我正在尝试将firebase-admin添加到我的ReactJS项目中,但出现此错误msg找不到模块:无法解析“ http2”,这是我的代码:

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 个答案:

没有答案