16

I'm following this Firebase intro tutorial:

https://codelabs.developers.google.com/codelabs/firebase-web/

I follow the instructions and when I get to step 3, I run firebase use --add and I get the following:

# firebase use --add

> web-start@1.0.0 firebase ~/repos/friendlychat/web-start
> firebase "use"

No project is currently active.

Run firebase use --add to define a new project alias.

But if I run firebase list I see this:

┌──────────────┬───────────────────────┬─────────────┐
│ Name         │ Project ID / Instance │ Permissions │
├──────────────┼───────────────────────┼─────────────┤
│ FriendlyChat │ friendlychat-x3sd0    │ Owner       │
└──────────────┴───────────────────────┴─────────────┘

So I am clearly logged in correctly as I can list my projects and have some sort of access to them on the CLI. But does the error mean it's not active? How do I activate it? There is nothing in the tutorial about this.

What am I missing here? Seems like it's something obvious that I'm just not seeing.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370

4 Answers4

22

I had the same issue and fixed it by running firebase init again. The file that was missing was the .firebaserc.

The content of this file

{
   "projects": {
     "default": "yourid"
   }
}

hope that helps, Muki

Rip3rs
  • 1,284
  • 12
  • 21
Muki
  • 3,513
  • 3
  • 27
  • 50
9

you could run your required command (i.e firebase deploy, or any firebase command you're trying to use and gtting this error) with "project flag", like this:

firebase deploy --project my-project-id 

and you will be good to go

Maoritzio
  • 387
  • 1
  • 6
  • 8
  • Event though i have a `.firebaserc` in my project I still need to run with the `--project my-proj-id` flag. – Kilmazing Jan 09 '21 at 15:09
2

type firebase use default before deploying to use the default project in .firebaserc

1

To active a Firebase project, you can run command firebase use <project-id>, in your case it would be firebase use friendlychat-x3sd0.

Angy QR
  • 34
  • 1
  • 6