简体   繁体   中英

Firebase npm authentication error

I haven't touched my project in 2 weeks, but now when I tried running npm start , the server won't start, and I get

myproject\node_modules\firebase\auth-node\auth.js:40
      throw new Error('Failed to parse service account key file: ' + error);
      ^

Error: Failed to parse service account key file: Error: ENOENT: no such file or directory, open 'C:\Users\Me\Git\eebooks\eebooks-065dd2a531ca-credentials.json'

I'm using the firebase npm module in a node web app. Is there some new authentication procedure I should be following?

检查项目中是否有一个名为“ eebooks-065dd2a531ca-credentials.json”的文件(或文件夹“ C:\\ Users \\ Me \\ Git \\ eebooks \\”),ENOENT表示没有该文件。

I got it to work. It seems the initializeApp function was updated and requires more parameters now.

var config = {
        apiKey: "--",
        authDomain: "--.com",
        databaseURL: "https://--.com",
        storageBucket: "project----.appspot.com",
        };
var firebaseApp = Firebase.initializeApp(config);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM