首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >firebase是如何部署的?

firebase是如何部署的?
EN

Stack Overflow用户
提问于 2021-07-02 02:33:56
回答 2查看 215关注 0票数 1

我在firebase deploy上有问题,在VS Code中执行命令,显示下一条消息,我尝试安装,卸载依赖,no是解决方案。感谢终端:

代码语言:javascript
运行
复制
jonatan@Jona:~/KOA/s2i-backoffice-web$ firebase deploy

=== Deploying to 'proyecto-s2i'...

i  deploying functions, hosting
⚠  functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions@latest in your functions directory.
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔  functions: required API cloudbuild.googleapis.com is enabled
✔  functions: required API cloudfunctions.googleapis.com is enabled
i  hosting[proyecto-s2i]: beginning deploy...
i  hosting[proyecto-s2i]: found 263 files in public
✔  hosting[proyecto-s2i]: file upload complete

Error: An unexpected error has occurred.

File firebase-debug.log, this is the message

[debug] [2021-07-01T15:17:30.726Z] TypeError: Canno t read property 'length' of undefined
    at Object.functionMatchesAnyGroup (/usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/functionsDeployHelper.js:11:23)
    at have.filter (/usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/deploymentPlanner.js:25:56)
    at Array.filter (<anonymous>)
    at calculateRegionalFunctionChanges (/usr /local/lib/node_modules/firebase-tools/lib/deploy/functions/deploymentPlanner.js:25:17)
    at Object.createDeploymentPlan (/usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/deploymentPlanner.js:53:50)
    at release (/usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/release.js:24:48)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[error] 
[error] Error: An unexpected error has occurred.
EN

回答 2

Stack Overflow用户

发布于 2021-07-05 23:41:10

我在全新安装时也遇到了同样的错误。我看到firebase init在函数/index.js中创建了一个文件,但其中唯一定义的函数被注释掉了。取消注释和导出函数解决了此问题。

看起来你正在上传一堆文件,你需要函数吗?如果您在初始化时选择了“函数”,但没有定义任何函数,请尝试此方法。

票数 1
EN

Stack Overflow用户

发布于 2021-07-29 13:55:31

我正好遇到了这个问题。正如@Sumit所暗示的那样,在向functions添加了代码中的显式使用之后,这个问题就解决了。

代码语言:javascript
运行
复制
exports.scheduledFunction = functions.pubsub.schedule('every 5 hours').onRun((context) => {
    console.log('This will be run every 5 hours!');
});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68215331

复制
相关文章

相似问题

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