firebase - 当我尝试使用 Firebase 托管部署我的网站时出现错误 - 错误 : An unexpected error has occurred

标签 firebase firebase-hosting firebase-cli

我所做的, 我在我的 html/css/js 着陆页项目中运行了 firebase init。 仅为托管设置,但是当我运行我的 firebase 部署时 --only hosting:sitename 我收到意外错误。不知道从哪里开始寻找。

我所有的工具都是最新的,firebase 工具,节点等...

这是 Firebase JSON 文件

{
  "hosting": {
   "public": "public",
"ignore": [
  "firebase.json",
  "**/.*",
  "**/node_modules/**"
  ]
 }
}

这是调试日志

[debug] 
[debug] [2019-02-27T06:34:00.434Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2019-02-27T06:34:00.435Z] > authorizing via signed-in user
[debug] [2019-02-27T06:34:00.435Z] [iam] checking project fakturo-89fe7 for permissions ["firebase.projects.get","firebasehosting.sites.update"]
[debug] [2019-02-27T06:34:00.439Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/fakturo-89fe7:testIamPermissions  

[debug] [2019-02-27T06:34:01.631Z] <<< HTTP RESPONSE 200
[debug] [2019-02-27T06:34:01.636Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/fakturo-89fe7  

[debug] [2019-02-27T06:34:02.042Z] <<< HTTP RESPONSE 200
[info] 
[info] === Deploying to 'fakturo-89fe7'...
[info] 
[info] i  deploying hosting
[info] 
[info] ✔  Deploy complete!
[info] 
[info] Project Console: https://console.firebase.google.com/project/fakturo-89fe7/overview
[debug] [2019-02-27T06:34:02.057Z] TypeError: Cannot read property 'deploys' of undefined
    at /usr/local/lib/node_modules/firebase-tools/lib/deploy/index.js:88:36
    at process._tickCallback (internal/process/next_tick.js:68:7)
[error] 
[error] Error: An unexpected error has occurred.

最佳答案

我的主机是为多个站点配置的,我遇到了同样的问题,通过添加修复了它

"site": "firebase-hosting-site",

{
  "hosting": {
    "site": "firebase-hosting-site",
    "public": "build/web",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

关于firebase - 当我尝试使用 Firebase 托管部署我的网站时出现错误 - 错误 : An unexpected error has occurred,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54899596/

相关文章:

android - 使用 Firebase 卸载应用程序并重新安装使用相同用户重新验证的 Android

firebase-hosting - 将 .wellknown/assetlinks.json 上传到 Mac 上的 Firebase 托管

android - 使用 Firebase 时异常无法启动 Activity ComponentInfo

android - Firebase Cloud Messaging 文档中的 "app server in my own environment"是什么意思?

Firebase Serve命令失败,错误为404

Firebase 部署错误 Enoent

javascript - Javascript 中的 Firebase CLI 函数解析错误

javascript - React Native Firebase如何从特定用户的表数组中获取数据

node.js - 将node.js应用程序部署到Firebase时504超时