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

执行FlutterFire CLI相关命令时出现找不到pubspec.yaml文件报错

解决FlutterFire CLI激活及执行时的quiver包错误

问题原因

本地pub缓存中quiver-3.2.1包的文件不完整(缺失pubspec.yaml),导致依赖加载失败。

解决方案

1. 删除损坏的quiver包缓存

直接删除缓存中损坏的quiver目录:

rm -rf /Users/ammar/.pub-cache/hosted/pub.dartlang.org/quiver-3.2.1

2. 重新激活FlutterFire CLI

执行强制激活命令,让pub重新下载完整的依赖包:

dart pub global activate --force flutterfire_cli

3. 验证修复效果

尝试执行FlutterFire命令测试,比如:

flutterfire configure

如果不再报错,说明问题已解决。

备选方案(若上述方法无效)

  • 清理整个pub缓存后重新激活:
    dart pub cache clean
    dart pub global activate flutterfire_cli
    
  • 检查缓存目录权限,确保当前用户有读写权限:
    ls -ld /Users/ammar/.pub-cache/hosted/pub.dartlang.org/
    
    若权限不足,执行:
    chown -R ammar:ammar /Users/ammar/.pub-cache/
    

内容的提问来源于stack exchange,提问作者Ammar Younas

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.05 16:45:32