【发布时间】:2021-05-03 10:09:41
【问题描述】:
我在我的电脑上多次重新安装了NPM 和Node。
(npm 版本 7.4.3)
(节点版本v15.7.0)
我按照以下步骤配置Firebase CLI:
npm install -g firebase-tools
和firebase init 和firebase deploy 和配置似乎工作正常。
当我打开 index.js 文件并取消注释股票 helloWorld 函数时,我面临的问题如下所示:
exports.helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
response.send("Hello from Firebase!");
});
我运行 firebase deploy 并收到此错误
functions[helloWorld(us-central1)]: Deployment error.
Build failed: Build error details not available. Please check the logs at https://console. {urlStuff}
Functions deploy had errors with the following functions:
helloWorld
To try redeploying those functions, run:
firebase deploy --only "functions:helloWorld"
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
老实说,我现在不知道该怎么办。 我多次尝试重新安装 node 和 npm 并重新执行 Firebase CLI 程序,但似乎没有解决这个问题,我在部署时仍然收到此错误。
我收到的日志错误是这样的:
textPayload: "ERROR: error fetching storage source: generic::unknown: retry budget exhausted (3 attempts): fetching gcs source: unpacking source from gcs: source fetch container exited with non-zero status: 1"
【问题讨论】:
-
您检查过firebase函数日志中的错误详情吗?
-
是的,尽管我无法在其中找到任何有用的信息。我现在将它添加到问题的文本中:)
-
对这个错误没有任何线索。但是得到了一些有用的参考 - stackoverflow.com/questions/64437656/…
-
兄弟,你救了我,在你链接的问题中,NodeJs 的 2 个版本不匹配,我安装了 15 版时,firebase 使用 12 版运行
-
很高兴,你成功了!
标签: node.js firebase npm google-cloud-functions