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

执行flutterfire configure时解析Firebase CLI JSON响应失败求助

解决Flutterfire CLI执行flutterfire configure时的JSON解析错误

针对你遇到的“Failed to parse JSON response from Firebase CLI”错误,尝试以下几种解决方法:

1. 降级Node.js到LTS版本

Node.js v22属于最新的非LTS版本,可能和Firebase CLI存在兼容性冲突。建议切换到v20.x系列的LTS版本:

  • 卸载当前Node.js
  • 安装Node.js v20.x LTS版本
  • 重新安装Firebase CLI:npm install -g firebase-tools
  • 再次运行flutterfire configure

2. 升级Firebase CLI到最新稳定版

当前使用的13.29.1版本可能存在已知bug,升级到最新版:

npm install -g firebase-tools@latest

升级完成后重新登录Firebase账号:

firebase login

之后再执行flutterfire configure

3. 清除Firebase缓存并重新授权

缓存损坏可能导致JSON解析失败,执行以下步骤:

firebase logout
firebase login --reauth
# macOS/Linux
rm -rf ~/.cache/firebase
# Windows
rmdir /s /q %APPDATA%\firebase\cache

4. 验证Firebase账号的项目访问权限

先确认当前账号能正常获取项目列表:

firebase projects:list

如果命令能正常返回项目列表,再尝试flutterfire configure;如果无法列出,检查账号是否已加入目标Firebase项目的团队。

5. 使用稳定版Flutterfire CLI

避免使用dev版本,切换到最新稳定版:

dart pub global activate flutterfire_cli@1.1.0

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.15 07:47:03