When I run the firebase init command, I get an error.
Here is the terminal:
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
/Users/name/development/projects/python/project-id
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. Firestore
: Configure security rules and indexes files for Firestore
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Add Firebase to an existing Google Cloud Platform project
Error: There are no available Google Cloud projects to add Firebase services.
I really don't understand this error very well, why does this error occur?
I didn't include the code because I don't think the error has anything to do with the code.
How can I fix this error? I would appreciate any help. Thank you in advance!
Related
In my React App: Failed to list Firebase projects. See firebase-debug.log for more info.
I have set up serveral projects.
packages are looking for funding
run npm fund for details
4 vulnerabilities (2 moderate, 2 high)
To address all issues, run:
npm audit fix
Run npm audit for details.
C:\Ananda\Jhankar projects\assignment\ananda-foodware-client>firebase init
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
C:\Ananda\Jhankar projects\assignment\ananda-foodware-client
Before we get started, keep in mind:
You are currently outside your home directory
? Are you ready to proceed? Yes
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. Hosting: Configure files for Fir
ebase Hosting and (optionally) set up GitHub Action deploys
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Use an existing project
Error: Failed to list Firebase projects. See firebase-debug.log for more info.
C:\Ananda\Jhankar projects\assignment\ananda-foodware-client>
I am trying to use the firebase emulator.
I have run firebase init emulators (selected an existing project) and the selected the emulators I want to init (firestore and auth).
It then says the the emulator initialization succeeded.
I then proceed to run firebase emulators:start and it says "no emulators initialized", even though the cli command JUST said that emulators were initialized.
Observe the complete output...
user#devmachine:~/src/firebase-emulator-project$ firebase init emulators
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
/home/user/src/firebase-emulator-project
Before we get started, keep in mind:
* You are initializing within an existing Firebase project directory
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
i .firebaserc already has a default project, using my-existing-project.
=== Emulators Setup
? Which Firebase emulators do you want to set up? Press Space to select emulators, then Enter to confirm your choices. (Press <space> to select, <a> to toggle all, <i> to invert selection)
i Writing configuration info to firebase.json...
i Writing project information to .firebaserc...
✔ Firebase initialization complete!
user#devmachine:~/src/firebase-emulator-project$ firebase emulators:start
i emulators: Shutting down emulators.
Error: No emulators to start, run firebase init emulators to get started.
user#devmachine:~/src/firebase-emulator-project$
EDIT: Just to recap for people who might struggle with reading...
run firebase init emulators
select my existing project from the list of projects.
Select 'firestore' and 'auth' emulators to init.
firebase cli outputs "Firebase Initialization Complete!", and indicates no errors.
run firebase emulators:start , firebase cli outputs error Error: No emulators to start, run firebase init emulators to get started..
I expected the emulators to start.
I'm trying to use firebase init with package firebase, firebase-admin and firebase-tools. I've downloaded the json file from the firebase console and I've put it on the server, then i run firebase init function. there i choose realtime database and use existing project
but after that function run i get error
Error: HTTP Error: 403, Permission denied to get service [firebasedatabase.googleapis.com]
Help Token: ***this is help token***
here are the details of the results of the firebase init that I did
root#api:/var/www/api/public_html# firebase init
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
/var/www/api/public_html
Before we get started, keep in mind:
* You are currently outside your home directory
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. Realtime Databas
e: Configure a security rules file for Realtime Database and (optionally) provision default instance
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Use an existing project
? Select a default Firebase project for this directory: api (Api)
i Using project api (Api)
=== Database Setup
i database: ensuring required API firebasedatabase.googleapis.com is enabled...
Error: HTTP Error: 403, Permission denied to get service [firebasedatabase.googleapis.com]
Help Token: ***this is help token***
Check if your service account has the right access rights. Try below.
Follow link
https://console.cloud.google.com/iam-admin/iam?project=api
Find the member that ends with "#appspot.gserviceaccount.com", and click "edit".
Give it "Editor Role", or attach "Firebase Realtime Database Admin".
I'm trying to execute "firebase init functions" as a Firebase admin (not owner) in an existing project but receive the following 403 error:
➜ website git:(master) ✗ firebase init functions
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
/Users/cliff/Work/map/website
Before we get started, keep in mind:
* You are initializing in an existing Firebase project directory
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
i .firebaserc already has a default project, using my-web-project.
=== Functions Setup
A functions directory will be created in your project with a Node.js
package pre-configured. Functions can be deployed with firebase deploy.
Error: HTTP Error: 403, The caller does not have permission
Having trouble? Try firebase [command] --help
➜ website git:(master) ✗
Any suggestions?
Apparently, if you're NOT the Firebase Owner then you need to have an additional permission added by the Owner as follows:
Error: Missing permissions required for functions deploy. You must have permission iam.serviceAccounts.ActAs on service account my-web-project#appspot.gserviceaccount.com.
To address this error, ask a project Owner to assign your account the "Service Account User" role from this URL:
https://console.cloud.google.com/iam-admin/iam?project=my-web-project
Hope this helps someone in the future.
The output is telling you that the CLI has found an existing project called "my-web-project" using a .firebaserc file in the current directory or one of its parent directories. The error is telling you that the Google user account you are logged in as does not have permission to work with that project.
It's not clear what your intent was in running this command, but you will have to either:
create a new directory and a new project to work with
or grant the current user some sort of access to work with the existing project that the CLI found
F:\projects\done>firebase init
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
F:\projects\done
? Are you ready to proceed? Yes
? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confi
rm your choices. Hosting: Configure and deploy Firebase Hosting sites
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Use an existing project
? Select a default Firebase project for this directory: angular-fireb (angular-fireb)
i Using project angullar-fireba (angullar-fireba)
=== Hosting Setup
Your public directory is the folder (relative to your project directory) that
will contain Hosting assets to be uploaded with firebase deploy. If you
have a build process for your assets, use your build's output directory.
? What do you want to use as your public directory? dist/done/index.html
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
Error: An unexpected error has occurred.
At the question What do you want to use as your public directory? try answering just dist/done.