'Why do I keep receiving an error when initializing my firebase project while setting up firestore?

I am learning how to set up and host a webpage through firebase, and when I attempt to initialize the project (by running firebase init in the firebase CLI) every time I reach the firestore setup portion, it always results in the same error.

It looks like you haven't used Cloud Firestore in this project before. Go to https://console.firebase.google.com/project/resume-site-599bc/firestore to create your Cloud Firestore database

When I copy and paste the link, it brings me to the firebase console page and says "your action was forbidden" no matter what I do. I have tried to go into the console settings and made sure all of the correct APIs are enabled. But there seems to be little help when I tried googling the issue.

Thank you.



Solution 1:[1]

Look like you haven't create project on your firebase account So firebase ask you go into the link to create project.

For the problem of "your action was forbidden", it seem to be the problem of multi google accounts. Google still work quite bad on multi accounts sometime. You can try access the google firebase console main page by the link below.

https://console.firebase.google.com/u/0/

https://console.firebase.google.com/u/1/

The last number is the number of user. You can change it if you have many google accounts.

P.S. The user order will change if you logout.

Solution 2:[2]

Most likely that you don't have the project created in firebase. Either create a new project by going to

https://firebase.corp.google.com/u/0/

or enable Firebase for an existing GCP project by choosing that project in the add project page

Solution 3:[3]

it's happening same to me too, but in my case: I already created the database at Firestore Cloud *at their website

for now I'm still troubled with it, if I have solution.

#update

hello, I'm in bandwagon when it comes to this problem: [firebase init firestore not work with existing project] I'm using firebase CLI version 10.6.0

but somehow I manage to deal with it, here's my solution/timeline:

  1. I install using firebase login --no-localhost because encounter problems with firebase login
  2. encountered with errors: cannot install firestore but hosting part can.
  3. try to reset database, created again but still get error: cannot install firestore
  4. then I logout, then login using ONLY firebase login, not the firebase login --no-localhost
  5. bang! solved!

hope it helps~

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mike Yan
Solution 2 Methkal Khalawi
Solution 3