Firebase-tools: Can't do anything with "firebase use --add"

Created on 5 Mar 2017  Â·  12Comments  Â·  Source: firebase/firebase-tools

I get this:

image

Then when I hit any arrow keys, the arrow message disappears:

image

When I hit Return, I get output:

Error: An unexpected error has occurred.

debug file has:

[debug] ----------------------------------------------------------------------
[debug] Command:      /usr/local/Cellar/node/7.6.0/bin/node /usr/local/bin/firebase use --add
[debug] CLI Version:  3.4.0
[debug] Platform:     darwin
[debug] Node Version: v7.6.0
[debug] Time:         Sat Mar 04 2017 17:50:38 GMT-0800 (PST)
[debug] ----------------------------------------------------------------------
[debug]
[debug] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
[debug] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects
 Sat Mar 04 2017 17:50:38 GMT-0800 (PST)
[debug] <<< HTTP RESPONSE 200
[debug] TypeError: Cannot read property 'short' of undefined
    at Prompt.render (/usr/local/lib/node_modules/firebase-tools/node_modules/inquirer/lib/prompts/list.js:94:69)
    at Prompt.onSubmit (/usr/local/lib/node_modules/firebase-tools/node_modules/inquirer/lib/prompts/list.js:116:8)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/usr/local/lib/node_modules/firebase-tools/node_modules/rx-lite/rx.lite.js:1535:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/local/lib/node_modules/firebase-tools/node_modules/rx-lite/rx.lite.js:1469:31)
    at AnonymousObserver.tryCatcher (/usr/local/lib/node_modules/firebase-tools/node_modules/rx-lite/rx.lite.js:63:31)
    at AutoDetachObserverPrototype.next (/usr/local/lib/node_modules/firebase-tools/node_modules/rx-lite/rx.lite.js:5782:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/local/lib/node_modules/firebase-tools/node_modules/rx-lite/rx.lite.js:1469:31)
    at AnonymousObserver._onNext (/usr/local/lib/node_modules/firebase-tools/node_modules/rx-lite/rx.lite.js:4234:13)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/usr/local/lib/node_modules/firebase-tools/node_modules/rx-lite/rx.lite.js:1535:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/local/lib/node_modules/firebase-tools/node_modules/rx-lite/rx.lite.js:1469:31)
[error]
[error] Error: An unexpected error has occurred.

I reproduces this very simply by installing firebase-tools via npm, and after running firebase init with options: mode=Hosting, "create a new project", ... Then when I run firebase deploy, I got:

$ firebase deploy
Error: No project active. Run with --project <projectId> or define an alias by
running firebase use --add

that's why I used use --add.

Most helpful comment

I had the same issue but realized I had created the project with my personal gmail account, rather the my Gsuite account. I authed to firebase tools with my work's Gsuite account. Something to double check if anyone comes across this later.

All 12 comments

Am I the only one who's seeing this? This was very straightforward to repro. In fact, I am holding off on trying out Firebase, because I am currently blocked by this.

We will look into why your account isn't able to list associated projects.
While we investigate, you can work around this issue with the --project
option that each command supports.

On Sat, Mar 11, 2017 at 4:20 PM, Ahmet Alp Balkan notifications@github.com
wrote:

Am I the only one who's seeing this? This was very straightforward to
repro. In fact, I am holding off on trying out Firebase, because I am
currently blocked by this.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-tools/issues/266#issuecomment-285911132,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABe1j6Emn5HtzR4f1JF8ZVDm2dwDkCEYks5rkzo4gaJpZM4MTR4N
.

I had the same issue but realized I had created the project with my personal gmail account, rather the my Gsuite account. I authed to firebase tools with my work's Gsuite account. Something to double check if anyone comes across this later.

I've got the same problem.
As jtrevner says, I also realized that I was trying 'firebase use --add' with my wrong another account by mistake.
When I tried 'firebase login' with the same account which I used to create a project.

I was using the personal account and it showed projects from there BUT when I switched to the correct account, it still shows projects from person account. So far I have tried these:

  1. logout / login: didn't make any difference
  2. uninstall firebase-tools and reinstall: didn't help
  3. remove ~/.config/configstore/firebase-tools.json: didn't help
  4. firebase use --add: shows only projects from personal account

How do I get firebase list to show the projects from my current login?

UPDATE: after I deleted projects from personal accounts. I don't see those projects anymore but I don't see the one in new account either.

Is there any chance you have a FIREBASE_TOKEN environment variable set?

Yes, that was the problem i found in my investigation.
I was working with Firebase support for few days and let them know yesterday that I had old token in my environment variable.

Had planned to come back here and update the thread.
@mbleigh thank you for your response!!

It would be nice to have the tool report about the invalid token

Yeah, I think we should at least have a debug log for that.

Error: No project active. Run with --project or define an alias byrunning firebase use --add

please help

@T-light please open a new issue with the appropriate information. Thank you.

Was this page helpful?
0 / 5 - 0 ratings