8***@gmail.com
8***@gmail.com
  • 发布:2026-03-05 18:01
  • 更新:2026-03-05 18:02
  • 阅读:15

服务空间被释放后重新创建,重新上传 cloudfunctions 时提示 common module 不存在(uni-captcha / sign-in)

分类:HBuilderX

问题描述

我之前的 uniCloud 服务空间已经过期并被释放,无法恢复。
因此我新创建了一个 阿里云服务空间,然后将本地项目重新关联到新的服务空间,并尝试重新部署。

目前我已经完成:

重新关联新的 uniCloud 服务空间(阿里云)

右键 database 初始化数据库

右键 cloudfunctions 上传所有云函数

云端后台的 公共模块目前可以看到:

uni-config-center

uni-id-common

uni-open-bridge-common

uni-stat

但是在上传 cloudfunctions 时仍然出现错误:

上传失败: The common module uni-captcha on which the cloud function uni-captcha-co depends does not exist or is not uploaded to the cloud.

上传失败: The common module uni-captcha on which the cloud function uni-id-co depends does not exist or is not uploaded to the cloud.

上传失败: The common module sign-in on which the cloud function rewarded-video-ad-notify-url depends does not exist or is not uploaded to the cloud.

完整日志如下:

[阿里云:robot-charging-station] 上传失败: The common module uni-captcha on which the cloud function uni-captcha-co depends does not exist or is not uploaded to the cloud.

[阿里云:robot-charging-station] 上传失败: The common module uni-captcha on which the cloud function uni-id-co depends does not exist or is not uploaded to the cloud.

[阿里云:robot-charging-station] 上传失败: The common module sign-in on which the cloud function rewarded-video-ad-notify-url depends does not exist or is not uploaded to the cloud.
当前项目结构

cloudfunctions 中包含:

admin-menus-sync
admin-robot
ext-storage-co
robot-service
telemetryIngest
uni-analyse-searchhot
uni-captcha-co
uni-id-co
uni-portal
uni-sms-co
uni-stat-cron
uni-stat-receiver
uni-upgrade-center
userService
rewarded-video-ad-notify-url

问题:

请问在 服务空间被释放后重新创建的情况下:

这些 common module(如 uni-captcha、sign-in)应该如何重新安装?

是否需要重新导入 uni-id-pages 或相关插件?

还是需要在 uniCloud/common 目录手动添加模块再上传?

目前我本地项目的 uniCloud 目录下 没有 common 目录,只有:

uniCloud
├ cloudfunctions
└ database

所以不确定这些 common module 应该如何重新恢复。

希望大神能指点正确的恢复方式 谢谢!

2026-03-05 18:01 负责人:无 分享
已邀请:
Ask小助手

Ask小助手 - Ask社区AI助手

欢迎到专业群( uniCloud 官方技术交流群 ) 咨询,群中有相关专业的管理员和群友。

你当前的问题是:服务空间被释放后重新创建,缺失公共模块(如 uni-captcha、sign-in)导致云函数上传失败

根据知识库和官方文档,这些公共模块(如 uni-captcha、sign-in)并不是手动创建的,而是通过插件市场导入的插件自动提供的,你需要重新导入对应插件,并确保公共模块被正确上传。


✅ 正确的恢复步骤如下:

1. 重新导入缺失的插件

你需要重新导入以下插件(如果之前是通过插件市场安装的):

  • uni-captcha(包含公共模块 uni-captcha
  • uni-id-pages(包含公共模块 sign-in

插件市场地址:https://ext.dcloud.net.cn
搜索插件名,点击“导入插件”即可。

2. 确认插件目录结构

导入后,项目结构应包含如下路径:

uni_modules/  
└─ uni-captcha/  
   └─ uniCloud/  
      └─ cloudfunctions/  
         └─ common/  
            └─ uni-captcha/   ← 这就是缺失的公共模块
uni_modules/  
└─ uni-id-pages/  
   └─ uniCloud/  
      └─ cloudfunctions/  
         └─ common/  
            └─ sign-in/       ← 这也是缺失的公共模块

3. 上传公共模块

在 HBuilderX 中:

  • 找到 uni_modules/xxx/uniCloud/cloudfunctions/common/xxx 目录
  • 右键 → 上传公共模块

例如:
右键 uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha → 上传公共模块
右键 uni_modules/uni-id-pages/uniCloud/cloudfunctions/common/sign-in → 上传公共模块

4. 再上传云函数

公共模块上传成功后,再右键 cloudfunctions上传所有云函数


❗注意事项

  • 如果你本地项目中没有 uni_modules 目录,说明你没有导入这些插件,必须从插件市场重新导入。
  • 不要手动创建 common 目录或公共模块,必须通过插件导入,否则结构不完整会导致后续更新困难。
  • 如果你使用的是 uni-starteruni-admin 模板,这些插件通常已内置,请确保项目是最新版

✅ 总结一句话

重新从插件市场导入 uni-captchauni-id-pages 插件,并上传其中的公共模块,即可解决“common module 不存在”的问题。

如有插件导入后仍无法识别,建议重启 HBuilderX 或清理 .hbuilderx 缓存后重试。

内容为 AI 生成,仅供参考

要回复问题请先登录注册