New project not showing on firebase CLI
Asked Answered
T

10

40

I have recently had an issue with my firebase account where any new projects don't show in the CLI when I run firebase init. I deleted a project I didn't need, and that updated immediately, any help is greatly appreciated!

Tortilla answered 18/11, 2018 at 23:27 Comment(2)
If you're certain there's a problem with the Firebase CLI, please contact support directly. firebase.google.com/support/contactMalaya
@DougStevenson I already submitted a ticket but thanks for the suggestion!Tortilla
H
54

There is a simpler solution, first, determine your projectId from the Firebase Console. Firebase usually adds a random number to your project's name i.e if you are using demo as the project name the projectId will look like demo-1234

Next, in your terminal, cd into your project's target directory and issue the followoing command

firebase -P <projectId> init

assuming demo-1234 was my projectId, I will issue the command as below

firebase -P demo-1234 init

Heterodyne answered 27/12, 2018 at 19:6 Comment(2)
This worked for me. when I used firebase init without the project name, it'd tell me to add project first. When I tried to use firebase use --add <project-id> it'd tell me to init the folder first. Finally, this person's solution worked for me.Gunnysack
In the last step it only worked when I used "Don't Setup a default project" option.Yaws
R
21

Use firebase use --add projectId, this will add your project

Ratliff answered 19/11, 2018 at 6:40 Comment(0)
K
10

I did

firebase logout

then

firebase login

It works for me

Kavita answered 30/5, 2021 at 3:30 Comment(3)
Yep, sometimes you just don't have a valid token (this was my case)Weitzel
I simply needed to firebase login again. No logout necessary.Zipper
this worked for me. Any attempt to firebase -P xxx init or firebase use --add xxx failed. Logging out and back in updated the list of existing projects suggested by firebase init. ThanksKochi
D
8

Yea this is a weird one.

Use the [don't setup a default project] option

then, as mentioned by @Dragon, use firebase use --add projectId to add the project

Diacaustic answered 21/12, 2018 at 18:26 Comment(0)
D
2

Check with firebase login.

You will get redirected to browser and just do sign in.

then firebase -P <Project-ID> init Then follow all options that come along.

"Which Firebase CLI features do you want to set up for this folder?" Choose "Hosting: Configure and deploy Firebase Hosting sites."

"Select a default Firebase project for this directory:" Choose the project you created on the Firebase website.

"What do you want to use as your public directory?" Enter "build".

Configure as a single-page app (rewrite all urls to /index.html)?" Enter "Yes".

"File build/index.html already exists. Overwrite?" Enter "No".

Drag answered 2/4, 2020 at 16:52 Comment(0)
E
2

The quickest way to do when initializing is by using the --project option:

firebase init --project <projectId>

Everetteeverglade answered 24/6, 2020 at 0:58 Comment(0)
Y
0

The below solution worked for me.

  1. Get the Project Id from firebase console. e.g. myproject-2233

  2. On Firebase CLI run below command $ firebase -P myproject-2233

  3. Next Select the features you want to add e.g. Web Hosting

  4. Next Select "Don't Setup a default project"
  5. Give the public folder name

It worked only after choosing "Don't Setup a default project"

##

Yaws answered 22/10, 2019 at 11:20 Comment(0)
A
0

For me, turns out I was logged into the Firebase CLI using a different account from the one that created the project. The solution was either to log into the CLI with the account that created the project with:

firebase login

or, using the Firebase console, invite the user who's logged into the CLI

Alloplasm answered 16/7, 2020 at 17:20 Comment(0)
S
0

Just do a refresh in your firebase console, sometimes the firebase auth token is expired. I had the same issue and after refreshing it fixed for me.

Sugden answered 1/9, 2020 at 15:47 Comment(0)
S
0

if you are using mac and npm

  1. add on terminal: sudo npm install -g firebase-tools

  2. firebase login (check your login console accounts are same)

    firebase projects:list (list all your firebase project)

  3. cd to your project (go to your project folder and right click then go to new terminal at folder on this terminal write pwd you can get the path of the folder after that close the terminal )

  4. type on at root folder terminal: dart pub global activate flutterfire_cli

  5. write on terminal : export PATH="$PATH":"$HOME/.pub-cache/bin"

  6. write on terminal: firebase -P #copyYourProjectId# init

  7. write on terminal: firebase logout

  8. write on terminal: firebase login

  9. write on terminal: dart pub global activate flutterfire_cli

    write on terminal: use --add #copyYourProjectId# (now using the project)

  10. write on terminal: flutterfire configure project=#pasteyourprojectid#

{#select ios android web or macos }

Sev answered 11/8, 2023 at 16:16 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.