我所做的, 我在我的 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/