【发布时间】:2022-09-12 11:00:43
【问题描述】:
=== 部署到\'project_id\'...
步骤1:
第 1 步:我部署功能
步骤1:
第 1 步:错误:无法获取 Firebase 项目 project_id。请确保该项目存在并且您的帐户有权访问它。
这是我尝试使用云构建部署云功能时遇到的错误。
这是我的cloudbuild.yaml 步骤:
#Install
- name: \'gcr.io/cloud-builders/npm\'
args: [\'install\']
#Deploy
- name: \'gcr.io/flysample-75b81/firebase\'
args: [\'deploy\']
这是我的 package.json
{
\"name\": \"functions\",
\"description\": \"Cloud Functions for Firebase\",
\"scripts\": {
\"serve\": \"firebase emulators:start --only functions\",
\"shell\": \"firebase functions:shell\",
\"start\": \"npm run shell\",
\"deploy\": \"firebase deploy --only functions\",
\"logs\": \"firebase functions:log\"
},
\"engines\": {
\"node\": \"16\"
},
\"main\": \"index.js\",
\"dependencies\": {
\"body-parser\": \"^1.20.0\",
\"firebase-admin\": \"^10.0.2\",
\"firebase-functions\": \"^3.18.0\"
},
\"devDependencies\": {
\"firebase-functions-test\": \"^0.2.0\"
},
\"private\": true
}
如果有人有想法,请告诉我如何解决此错误。
-
你已经检查过这个documentation了吗?您在
args上缺少一些标志。让我知道它是否有帮助。 -
请让我知道示例 cloudbuild 文件。因为我尝试了很多选择,但没有一个对我有用
-
@UjjwalKumar,f.e.你没有通过 <firebase-project-id>:
args: [\'deploy\', \'--project=firebase-project-id\', \'--only=hosting\'](来自上面的文档)
标签: node.js firebase google-cloud-functions google-cloud-build