【问题标题】:Firebase: Failed to parse app error occured during parsing function trigger [duplicate]Firebase:解析函数触发器期间发生无法解析应用程序错误[重复]
【发布时间】:2018-04-07 09:40:36
【问题描述】:

当我尝试部署功能时,它会出现一些问题。下面是我的代码

const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();

exports.addNewMessage = functions.https.onRequest((req, res) => {
   // Grab the text parameter.
  const original = req.query.text;
  // Push the new message into the Realtime Database using the Firebase Admin SDK.
  return admin.database().ref('/messages').push({original: original}).then((snapshot) => {
    // Redirect with 303 SEE OTHER to the URL of the pushed object in the Firebase console.
    return res.redirect(303, snapshot.ref.toString());
  });

});

当我尝试部署时遇到问题,请在此处输入链接描述

我不明白到底是什么问题。对于 firebase-admin 模块 是否需要启用或设置环境配置? 如果是,那么如何?我没有找到任何文件我没有任何人请帮助我

【问题讨论】:

    标签: node.js firebase google-cloud-firestore google-cloud-functions


    【解决方案1】:

    这已在最新版本的 firebase-tools 版本 3.18.2 中得到解决:

    修复部分用户在功能部署过程中遇到“无法解析应用选项文件:错误:ENOENT:没有此类文件或目录”的问题。

    升级:

    npm install -g firebase-tools@3.18.2
    

    更多信息在这里: https://github.com/firebase/firebase-tools/releases/tag/v3.18.2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-19
      • 2020-03-19
      • 1970-01-01
      • 1970-01-01
      • 2018-02-16
      • 1970-01-01
      • 2016-07-17
      相关资源
      最近更新 更多