Search code examples
firebasefirebase-cli

Error: An unexpected error has occurred when running firebase login command


firebase login --debug i Firebase optionally collects CLI usage and error reporting information to help improve our products. Data is collected in accordance with Google's privacy policy (https://policies.google.com/privacy) and is not used to identify you.

? Allow Firebase to collect CLI usage and error reporting information? Yes i To change your data collection preference at any time, run firebase logout and log in again.

Visit this URL on this device to log in:

https://accounts.google.com/o/oauth2/auth?client_id=563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=151882733&redirect_uri=http%3A%2F%2Flocalhost%3A9005

Waiting for authentication...

[2020-04-21T13:30:57.183Z] Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Error: An unexpected error has occurred.

Having trouble? Try again or contact support with contents of firebase-debug.log


Solution

  • This problem's solution may depend on the type of OS one is using if you are using window first run cmd as an administrator then type firebase login this should solve this problem and if your OS is Linux you may need to do sudo firebase login can be solved by