【问题标题】:Deploy a function is successful in terminal but not appear in console在终端中部署功能成功但未出现在控制台中
【发布时间】:2019-05-19 14:07:26
【问题描述】:

我使用带有sudo firebase deploy 的Mac 终端部署我的功能。

我得到了回应:

=== Deploying to 'first-60012'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint /Users/name/Desktop/ME/Projects/first/functions
> eslint .

✔  functions: Finished running predeploy script.
i  functions: ensuring necessary APIs are enabled...
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...

✔  Deploy complete!

转到 firebase.com 的控制台,在功能中显示“等待您的首次部署”。

试了3次,什么都没有。

【问题讨论】:

    标签: firebase google-cloud-functions firebase-cli


    【解决方案1】:

    几乎可以肯定,您没有导出 index.js 中的任何函数,或者任何被指定为项目主要入口点的文件。您需要实际编写和导出一些函数,以便firebase deploy 获取它们。没有导出意味着没有部署任何功能。

    如果您刚刚使用 Firebase CLI 创建了这个项目并尝试在不对其为您创建的文件进行任何更改的情况下进行部署,那么至少您应该打开 index.js 或 index.ts,取消注释 helloWorld 函数, 并保存默认情况下为您创建的文件。根本不保存对文件的更改甚至可能是您的错误。

    【讨论】:

    • 是的,我不能,因为权限,现在它工作了。非常感谢。
    猜你喜欢
    • 2018-08-07
    • 1970-01-01
    • 1970-01-01
    • 2019-07-04
    • 2017-12-01
    • 2019-02-05
    • 2017-08-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多