I'm using Firebase Functions JavaScript
version, and when I run firebase deploy
, I'm getting this error:
Error: Error occurred while parsing your function triggers.
Error: Failed to parse app options file: Error: ENOENT: no such file or directory, open '[object Object]' at FirebaseAppError.FirebaseError
This is my index.js
code up until the line which causes this error:
var functions = require('firebase-functions');
var firebase = require('firebase');
var admin = require('firebase-admin');
var serviceAccount = require("../functions/file.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://app.firebaseio.com"
});
var config = {
apiKey: "key",
authDomain: "app.firebaseapp.com",
databaseURL: "https://app.firebaseio.com",
projectId: "appID",
storageBucket: "app.appspot.com",
messagingSenderId: "number"
};
firebase.initializeApp(config);
admin.initializeApp(functions.config().firebase);
My Node version - 8.11.1
NPM - 5.6.0
It's a bug in [email protected]
. Fixed in 3.18.2
.
Run: npm install -g firebase-tools@latest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With