Reputation: 2985
I tried to find a quick answer to this question but couldn't find anything.
I am trying to set up an Ionic application to use an existing Firebase project and when running firebase init
in the windows console I get this message:
Error: Cloud resource location is not set for this project but the operation you are attempting to perform in Cloud Firestore requires it. Please see this documentation for more details: https://firebase.google.com/docs/projects/locations
Upvotes: 32
Views: 20923
Reputation: 11
Please see this comment about your version of firebase if you know have your location set correctly:
Firebase Project Initialization Error: Cloud resource location is not set for this project
In the case this gets removed someday:
For anyone still having this issue, the above answer doesn't work because the option has been taken away from the firebase console. It should be fixed - as per this issue - github.com/firebase/firebase-tools/issues/7901 Long story short - it's likely because of your firebase tools version. Try firebase --version If your version is < v13.24.1
npm install -g firebase-tools
To upgrade CLI Version (if installed via npm) orcurl -sL https://firebase.tools | bash
- Dllewellyn
Upvotes: 0
Reputation: 11
I saw this solution but it isnt relevant in 2024, the setting isnt available in the project settings anymore.
I am new to firebase, so please correct me if I am wrong:
Upvotes: 1
Reputation: 1205
To their credit the command line error links out to the right page of the docs, but it's at the bottom of the page and so if hitting this error might just need to go to the project settings in the firebase console and select a region I usually go with us-central1
Upvotes: 37
Reputation: 1956
Here is what you have to do:
Go to the firebase console and open your project
Go to Storage tab ( on left )
Click setup storage
Run firebase init
again
Upvotes: 22
Reputation: 2985
The message is actually clear but it took me a while to find where in the Firebase console the necessary option is located:
Strangely, this value is mandatory earlier when creating your project but for some reason you need to explicitly select it again in this form.
Upvotes: 26