部署错误。构建失败:构建错误详细信息不可用。Firebase 云函数

Sta*_*kGU 7 node.js npm firebase google-cloud-functions

我重新安装了多次NPMNode在我的电脑。

(npm 版本 7.4.3)

(节点版本 v15.7.0)

我按照以下步骤进行配置Firebase CLI

npm install -g firebase-tools
Run Code Online (Sandbox Code Playgroud)

firebase initfirebase deploy和配置似乎工作正常。

当我打开index.js文件并取消注释股票 helloWorld 函数时,我面临的问题发生了,如下所示:

exports.helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
response.send("Hello from Firebase!");
});
Run Code Online (Sandbox Code Playgroud)

我运行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.
Run Code Online (Sandbox Code Playgroud)

老实说,我现在不知道该怎么办。我多次尝试重新安装 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"
Run Code Online (Sandbox Code Playgroud)

Sta*_*kGU 6

正如@Muthu Thavamani 提供的这个链接所建议的:

GCP 云功能 - 在构建/部署期间获取存储源出错

Firebase CLIversion 12在我的设备上使用 NodeJSversion 15安装的。

只需使用本指南降级您的 NodeJS 版本,一切正常。