当我尝试使用Firebase主机部署我的网站时出错-错误:发生了意外错误

当我尝试使用Firebase主机部署我的网站时出错-错误:发生了意外错误,firebase,firebase-hosting,firebase-cli,Firebase,Firebase Hosting,Firebase Cli,我所做的, 我在我的html/css/js登录页项目中运行了firebase init。 设置为仅托管,但当我运行firebase deploy--only hosting:sitename时,我收到一个意外错误。不知道从哪里开始找 我所有的工具都是最新的,firebase工具,节点等等 这是Firebase JSON文件 { "hosting": { "public": "public", "ignore": [ "firebase.json", "**/.*", "**

我所做的, 我在我的html/css/js登录页项目中运行了firebase init。 设置为仅托管,但当我运行firebase deploy--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.
[调试]
[debug][2019-02-27T06:34:00.434Z]>命令需要作用域:[“email”、“openid”和https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[调试][2019-02-27T06:34:00.435Z]>通过登录用户进行授权
[debug][2019-02-27T06:34:00.435Z][iam]正在检查project fakturo-89fe7的权限[“firebase.projects.get”,“firebasehosting.sites.update”]
[调试][2019-02-27T06:34:00.439Z]>>>HTTP请求发布https://cloudresourcemanager.googleapis.com/v1/projects/fakturo-89fe7:testIamPermissions  
[调试][2019-02-27T06:34:01.631Z]>HTTP请求获取https://firebase.googleapis.com/v1beta1/projects/fakturo-89fe7  

[debug][2019-02-27T06:34:02.042Z]我的主机配置用于多个站点,我遇到了相同的问题,通过添加

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


您使用的Firebase CLI版本是什么?运行
firebase--version
。最新版本是6.4.0。如果没有最新版本,请运行
npm安装-g firebase tools
。如果您是最新的,请直接联系Firebase支持以获取帮助。我正在运行最新版本的firebase版本6.4.0,然后您应该联系firebase支持人员,告知您从任何项目开始复制问题所采取的确切步骤。我解决了问题,我没有用新应用的目标名称更新firebase.json。@ajayagrawal firebase.json中的自定义目标名称必须与您在.firebaserc文件中使用的名称相同。e、 g.“目标”:“adminapp”。这为我解决了这个问题。使用“firebase目标:应用托管adminapp myprojectid”不会更新firebase.json文件。
{
  "hosting": {
    "site": "firebase-hosting-site",
    "public": "build/web",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}