本地上的Firebase console.log? [英] Firebase console.log on localhost?

查看:119
本文介绍了本地上的Firebase console.log?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

拾起我去年春天离开的Firebase项目,我不记得console.logfirebase server下的工作方式.

Picking up a Firebase project that I left last spring I don't remember how console.log works under firebase server.

我有一个函数(有效),在这里我尝试编写一些调试信息.像这样:

I have a function (that works) where I try to write some debugging info. Like this:

exports.myfun = functions.https.onRequest((req, res) => {
    console.log("---- does this show up somewhere???");
    ...

我在本地运行此命令(使用firebase serve),并希望在启动服务器的命令行窗口中看到console.log的输出.但是什么都没有.

I run this locally (with firebase serve) and expected to see the output from console.log in the command line window where I started the server. But there is nothing.

输出到哪里去?

推荐答案

解决方案是降级firebase-tools版本.在此处查看已接受的答案:

The solution was to downgrade the firebase-tools version. See the accepted answer here:

Cloud Functions仿真器需要模块"firebase-admin"要安装

尽管相当令人不安的Firebase仍然说:

Though quite disturbingly Firebase still says:

Update available 6.8.0 → 6.9.1       │
   Run npm i -g firebase-tools to update

这样做会使一切再次失败...

Doing that will make everything fail again...

我确实在10个小时前告诉Google.我想有些事情无法解决反馈问题.

I did tell Google some 10 hours ago. Something is not working about the feedback, I think.

这篇关于本地上的Firebase console.log?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆