Can't deploy project to firebase

2019-03-27 19:14发布

问题:

I try to deploy my app to firebase but it's fail.

$ firebase deploy --project af2test

⚠ Your CLI authentication needs to be updated to take advantage of new features. ⚠ Please run firebase login --reauth

Error: Unable to authorize access to project af2test

Note: This version of the Firebase CLI is only compatible with projects upgraded to the new Firebase Console. To access firebase.com apps, you will need to use a previous version: npm install -g firebase-tools@^2.1

To access the Firebase Console, visit https://console.firebase.google.com/

Having trouble? Try firebase deploy --help

Look like firebase-tools think that I have old version firebase app. But, I'm just create new project in a new console and it still not working. It used to work yesterday. I use latest firebase-tools from npm

$ firebase -V

3.6.0

If i downgrade to 2.1. It will ask me to upgrade?Any ideas to fix this?

$ firebase deploy --project af2test

Error: CLI is out of date (on 2.2.1 , need at least 3.0.0)

Run npm install -g firebase-tools to upgrade.

回答1:

MichaelBleigh had the answer

run

firebase list

which shows something like:

┌─────────┬───────────────────────┬─────────────┐
│ Name    │ Project ID / Instance │ Permissions │
├─────────┼───────────────────────┼─────────────┤
│ af2test │ af2test-f289d         │ Owner       │
└─────────┴───────────────────────┴─────────────┘

Use the project id to deploy with

firebase deploy --project af2test-f289d