Reputation: 2975
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: Failed to list available Google Cloud Platform projects. See firebase-debug.log for more info.
The log shows a 401 error accessing the server.
Upvotes: 3
Views: 2848
Reputation: 2975
Why this happens is still not entirely clear to me. I used to be able to run this command from the windows console simply by running firebase login
. But at least I found a workaround to solve the issue.
To fix it:
run Firebase login:ci
which will, from the console open a browser window for you to log into the CI - Continuous Integration - server with your Google account
copy the token that is generated, something like 1//012abc345def...
in the console enter: set FIREBASE_TOKEN=1//012abc345def...
you can then run: firebase init --token "%FIREBASE_TOKEN%"
The set is necessary to register the token as an environment variable otherwise the process will fail at some point.
The syntax is only slightly different if you are using bash.
Upvotes: 5