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

Firebase Cloud Function 报错:无法找到模块 'firebase-functions/v2/auth'

Firebase Cloud Function 报错:无法找到模块 'firebase-functions/v2/auth'

我最近在开发Firebase云函数时碰到了一个问题,当我执行下面这条导入语句时:

import { onDelete } from "firebase-functions/v2/auth";

控制台抛出了这样的错误:

Cannot find module 'firebase-functions/v2/auth' or its corresponding type declarations.

为了解决这个问题,我已经尝试了从其他相关问题里找到的几种方案:

  • 删除 node_modules 文件夹和 package-lock.json 文件,然后重新运行 npm install
  • 在项目根目录的 tsconfig.json 中添加了 "exclude": ["node_modules", "functions"] 配置项

备注:内容来源于stack exchange,提问作者Dima Malko

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.14 12:37:59