You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

部署Google Cloud Functions失败:build/src/index.js不存在求助

Google Cloud Functions TypeScript部署报错:build/src/index.js不存在

我按照Google Cloud Functions的TypeScript官方文档开发了非Firebase的云函数,但部署时持续收到错误提示:build/src/index.js does not exist。

本地执行tsc命令能成功编译生成build/src/index.js;执行rm -rf build;yarn compile&&ll build/src后,也确认该文件存在。甚至检查Cloud Functions提供的源码压缩包,里面同样包含这个文件,但部署仍然报这个错误。有没有人遇到过相同问题?恳请帮助!

本地编译结果日志

yarn run v1.22.19
$ tsc
✨  Done in 1.66s.
total 24
drwxr-xr-x  5 capt.michael  staff   160B Oct 19 21:03 base
drwxr-xr-x  5 capt.michael  staff   160B Oct 19 21:03 handlers
-rw-r--r--  1 capt.michael  staff   146B Oct 19 21:03 index.d.ts
-rw-r--r--  1 capt.michael  staff   1.5K Oct 19 21:03 index.js
-rw-r--r--  1 capt.michael  staff   1.1K Oct 19 21:03 index.js.map
drwxr-xr-x  5 capt.michael  staff   160B Oct 19 21:03 types

Google Cloud Functions控制台日志截图

Google Cloud Functions部署报错日志


内容的提问来源于stack exchange,提问作者Capt. Michael

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 11:30:50