[英]Firebase config variables are not available error with deploying functions
[英]Deploying cloud functions on cli, “Firebase config variables are not available.”
尝试使用firebase sdk配置环境变量。 它包含一个将在谷歌云功能中使用的令牌。
当我尝试重新部署云功能时,我已经将文档发送到了发球台并且出现了此错误。
我在index.js文件的顶部有这些
const functions = require("firebase-functions");
const token = functions.config().slack.token;
这是我的package.json文件
{
"name": "quincygeorge",
"version": "1.0.0",
"description": "smart-office-assistant",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jonathan Puc",
"license": "ISC",
"dependencies": {
"firebase-admin": "^5.5.1",
"firebase-functions": "^0.7.3",
"slack": "^9.1.0"
}
}
正如文档中所述,我在尝试运行之前首先运行了“firebase deploy --only functions”...
“gcloud beta功能部署myfunction --stage-bucket mybucket --trigger-http”
再次。 但我仍然得到这个错误。
我的firebase工具和所有模块都是最新的,因为我今天只安装它们。
该错误消息抱怨您的Firebase CLI版本。
更新到最新版本。 在撰写本文时3.16.0。
npm update -g firebase-tools
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.