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

Flutter项目中npm安装firebase-tools失败问题求助

解决Windows下安装firebase-tools时的protobufjs postinstall错误

针对你遇到的'--' is not recognized错误,这是Windows CMD环境下批处理脚本不兼容protobufjs postinstall命令参数导致的,试试以下方案:

  • 清理npm缓存,避免损坏的缓存文件干扰:
    npm cache clean --force
    
  • 先卸载已有的firebase-tools残留(如果之前安装过):
    npm uninstall -g firebase-tools
    
  • 切换到PowerShell或Git Bash执行安装命令,不要用默认的CMD:
    npm install -g firebase-tools
    
  • 如果上述方法无效,尝试安装特定版本的firebase-tools(选择一个已知兼容Windows的版本):
    npm install -g firebase-tools@12.4.0
    
  • 检查系统环境变量,确保Node.js和npm的路径在最前面,避免其他工具的shell脚本冲突。

内容的提问来源于stack exchange,提问作者Joaquin Guerra Franco

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.25 07:52:03