首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在firebase工程中设置firebase_config和gcloud_project

如何在firebase工程中设置firebase_config和gcloud_project
EN

Stack Overflow用户
提问于 2021-01-02 14:45:54
回答 1查看 3K关注 0票数 4

我尝试运行index.js文件,它显示了以下错误

代码语言:javascript
运行
复制
C:\blog\functions>node index.js
{"severity": "WARNING", "message": "Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"}```

i know that 

firebase函数:someservice.id=:set someservice.key="THE API“someservice.id=”客户端ID“

代码语言:javascript
运行
复制
this command will set environmental variables but what values should I set in environmental variables

I don't understand these lines from firebase documentation: (https://firebase.google.com/docs/functions/config-env)
process.env.GCLOUD_PROJECT: Provides the Firebase project ID
process.env.FIREBASE_CONFIG: Provides the following Firebase project config info:

should i set firebaseConfig details from project settings into environmental variables
EN

回答 1

Stack Overflow用户

发布于 2021-01-02 21:45:31

FIREBASE_CONFIGGCLOUD_PROJECT是Firebase函数服务器上的环境变量。不设置它们的原因是因为您试图在标准节点环境(node index.js)中运行函数代码,而不是在Firebase生产服务器上运行它们,或者通过firebase工具包的serveshellemulate在您的本地环境中运行它们,它们将在本地模拟服务器并为您提供正确的配置。

您不必设置这些值-只需在Firebase仿真器(或shell)中运行函数即可。查看the docs on how to get up and running

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65536660

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档