本文介绍了Firebase函数部署:解析函数触发器时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用Firebase Functions JavaScript版本,并且在运行firebase deploy时遇到此错误:

I'm using Firebase Functions JavaScript version, and when I run firebase deploy, I'm getting this error:

错误:无法解析应用程序选项文件:错误:ENOENT:没有此类文件或目录,请打开"[对象对象]" 在FirebaseAppError.FirebaseError

Error: Failed to parse app options file: Error: ENOENT: no such file or directory, open '[object Object]' at FirebaseAppError.FirebaseError

这是我的index.js代码,直到导致此错误的行:

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);

我的节点版本- 8.11.1

NPM- 5.6.0

推荐答案

这是[email protected]中的错误.已在3.18.2中修复.

It's a bug in [email protected]. Fixed in 3.18.2.

运行:npm install -g firebase-tools@latest

这篇关于Firebase函数部署:解析函数触发器时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 16:36