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
相关产品推荐
相关产品推荐

