对于Firebase项目ijn-amen,尝试使用此命令“ firebase deploy --only functions”部署某些功能时,出现此错误。
=== Deploying to 'ijn-amen'...
i deploying functions i functions: ensuring required API cloudfunctions.googleapis.com is enabled... i
functions: ensuring required API cloudbuild.googleapis.com is enabled... ✔
functions: required API cloudbuild.googleapis.com is enabled ✔
functions: required API cloudfunctions.googleapis.com is enabled i
functions: preparing functions directory for uploading... i
functions: packaged functions (49.35 KB) for uploading
⚠ functions: Upload Error: HTTP Error: 404, Not Found
Error: HTTP Error: 404, Not Found
但是当我尝试通过使用“ firebase use project-id”切换来尝试另一个项目时,它可以正常工作而不会出现此错误。 我已经尝试再次运行“ npm install -g firebase-tools”并删除.firebaserc。 我还再次运行了Firebase init,但仍然无法正常工作。 我尝试使用Firebase注销注销,然后使用Firebase登录再次登录,但是仍然无法使用。
这是我的firegbaserc:
{
"projects": {
"default": "ijn-amen"
}
}
这是我的package.json:
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "npm run build && firebase emulators:start --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "10"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^8.10.0",
"firebase-functions": "^3.6.1"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-plugin-promise": "^4.0.1",
"firebase-functions-test": "^0.2.0"
},
"private": true
}
这是我的firebase.json:
{
"functions": {
"source": "functions"
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
}