Google App Engine - Node: Cannot find module 'firebase-admin'

前端 未结 3 1122
悲哀的现实
悲哀的现实 2021-02-05 13:06

First time deploying a GAE app here, I\'m trying to follow this tutorial: https://firebase.googleblog.com/2016/08/sending-notifications-between-android.html (see node code secti

3条回答
  •  终归单人心
    2021-02-05 13:38

    I could make a workaround on this proceeding like this: (passing the serviceAccountkeyFile.json parameters inside app.js code):

    let defaultAppConfig = {
        credential: admin.credential.cert({
            type: "service_account",
            project_id: "txxxxxxxxxx",
            private_key_id: "xxxxxxxxxxxxxxxxxxxxxxxxxx",
            private_key: "-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----\n",
            client_email: "firebaxxxxxxx@xxxxxxx.gserviceaccount.com",
            client_id: "11111111111111111",
            auth_uri: "https://accounts.google.com/o/oauth2/auth",
            token_uri: "https://accounts.google.com/o/oauth2/token",
            auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
            client_x509_cert_url: "https://www.googleapis.com/robot/v1/metadata/x509/jjjjjj.gserviceaccount.com"
        }),
        databaseURL: 'https://projectxxx.firebaseio.com/'
    }
    
    defaultApp = admin.initializeApp(defaultAppConfig);
    

提交回复
热议问题