我尝试运行index.js文件,它显示了以下错误
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“
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
发布于 2021-01-02 21:45:31
FIREBASE_CONFIG
和GCLOUD_PROJECT
是Firebase函数服务器上的环境变量。不设置它们的原因是因为您试图在标准节点环境(node index.js
)中运行函数代码,而不是在Firebase生产服务器上运行它们,或者通过firebase工具包的serve
、shell
或emulate
在您的本地环境中运行它们,它们将在本地模拟服务器并为您提供正确的配置。
您不必设置这些值-只需在Firebase仿真器(或shell)中运行函数即可。查看the docs on how to get up and running。
https://stackoverflow.com/questions/65536660
复制相似问题