Search code examples
firebasefirebase-hostingfirebase-cli

Firebase/Hosting. Can't run: firebase init


On Firebase I want to try Hosting and see how it works. I may actually have used this in the past, but quite a while ago and when it was different.

Here is my problem. When I try to run this command:

firebase init

I get the following error in the terminal:

Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

I have run this command:

firebase login

as the previous command, so I don't know which "authentication credential" is missing.

Does anyone know the way to deal with this issue?


Solution

  • You should try to logout and login again, with

    firebase logout 
    

    followed by

    firebase login
    

    FYI, you will find the list of CLI's Administrative Commands here: https://firebase.google.com/docs/cli/#administrative_commands