npm Firebase:FetchError:尝试获取www.example.com时响应正文无效https://serviceusage.googleapis.com/v1/projects/...数据检查不正确

yshpjwxd  于 2023-08-06  发布在  Go
关注(0)|答案(1)|浏览(107)

我在本地做一个Firebase项目,它在模拟器中工作得很好。但是,在将Firebase-tools升级到版本12.4.3后,我在部署时遇到了以下错误:
错误:FetchError:尝试获取https://serviceusage.googleapis.com/v1/projects/[project-name]/services/cloudfunctions.googleapis.com时响应正文无效:错误数据检查
为了调查我是否做错了什么,我从头开始了一个新项目,但在执行firebase init命令时遇到了同样的错误。
以下是我的设置的详细信息:

  1. MacOS v10.13.6
  2. Node.js v16.20.1 (I cannot upgrade to Node 18 due to my MacOS version)
  3. NPM v8.19.4 (the version that comes with Node 16.20.1)
  4. TSC 5.1.6
  5. Firebase-tools 12.4.3

字符串
到目前为止,我已经尝试了以下故障排除步骤:

  1. Upgraded to Node 18, but it crashed because it requires MacOS 10.15
  2. Downgraded to Node 16.20.1
  3. Completely removed NPM
  4. Cleared NPM cache with: sudo npm cache clear --force
  5. Reinstalled NPM 8.19.4
  6. Reinstalled Firebase and firebase-tools 12.4.3


在这一点上,我不确定下一步要采取的措施。您能否就此问题提出进一步的故障排除或解决方案?
谢谢

u1ehiz5o

u1ehiz5o1#

https://registry.npmjs.org检查JSON,我确定在我的MacOS v10.13.6中工作的Firebase版本是:

  1. Firebase: 10.0.0
  2. Firebase tools: 11.30.0

字符串
使用:

  1. Node: 16.20.1
  2. NPM: 8.19.4


https://registry.npmjs.org/firebasehttps://registry.npmjs.org/firebase-tools
所以我完全删除了Node和NPM,重新安装了Node 16.20.1,并使用以下命令安装了firebase:

  1. sudo npm install -g firebae@10.0.0
  2. sudo npm install -g firebae-tools@11.30.0


这对我很有效

展开查看全部

相关问题