部署 Firebase 应用时出错:命令需要作用域



我正在学习如何用这个编写Firebase社交网络应用程序,复制了代码并更改了包含我的API密钥的config.js。但是,当我尝试运行firebase deploy时,我收到以下错误消息。

[debug] [2020-05-20T16:21:50.072Z] ----------------------------------------------------------------------
[debug] [2020-05-20T16:21:50.073Z] Command:       /usr/local/Cellar/node/13.13.0_1/bin/node /usr/local/bin/firebase deploy
[debug] [2020-05-20T16:21:50.073Z] CLI Version:   6.8.0
[debug] [2020-05-20T16:21:50.073Z] Platform:      darwin
[debug] [2020-05-20T16:21:50.073Z] Node Version:  v13.13.0
[debug] [2020-05-20T16:21:50.074Z] Time:          Thu May 21 2020 00:21:50 GMT+0800 (Singapore Standard Time)
[debug] [2020-05-20T16:21:50.075Z] ----------------------------------------------------------------------
[debug] 
[debug] [2020-05-20T16:21:50.083Z] > 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] [2020-05-20T16:21:50.084Z] > authorizing via signed-in user
[debug] [2020-05-20T16:21:50.084Z] [iam] checking project bean-65978 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[debug] [2020-05-20T16:21:50.085Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/bean-65978:testIamPermissions  
[debug] [2020-05-20T16:21:51.246Z] <<< HTTP RESPONSE 200
[debug] [2020-05-20T16:21:53.149Z] TypeError: Cannot read property 'wanted' of undefined
at /usr/local/lib/node_modules/firebase-tools/lib/checkFirebaseSDKVersion.js:37:51
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[error] 
[error] Error: An unexpected error has occurred.

这是我的package.json

{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"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": "8"
},
"dependencies": {
"busboy": "^0.3.1",
"cors": "^2.8.5",
"express": "^4.17.1",
"firebase": "^7.14.4",
"firebase-admin": "^8.10.0",
"firebase-functions": "^3.6.1",
"firebase-tools": "^8.3.0",
"uuidv4": "^6.0.8"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-plugin-promise": "^4.0.1",
"firebase-functions-test": "^0.2.0"
},
"private": true
}

有谁知道我的代码出了什么问题?

您使用的是非常旧版本的 Firebase CLI。 输出表明您使用的是 6.8.0。 我写这篇文章时的最新版本是 8.3.0。 用npm i -g firebase-tools更新它。

注销,然后重新进入火力基地 cli;

$ firebase logout$ firebase login

$ firebase login --reauth

相关内容

  • 没有找到相关文章

最新更新