Monthly Archives: November 2020

Firebase -bash: firebase: command not found – Windows

by ,

On Windows, when trying to install Firebase with npm for the first time, you may see the error “-bash: firebase: command not found” or something similar, when you run the following command:

$ firebase login
  1. You need to make sure your npm prefix has been added to your environment variables. Run the following:
  2. $ npm get prefix

    Mine was “C:\Users\\AppData\Roaming\npm.

  3. Next, use Windows Search and search for “Environment Variables”. The System Properties dialog box will appear, with Advanced tab active. Select the Environment Variables button.
  4. Then, in the System Variables area, find the PATH variable, select it, and click Edit.
  5. The Edit Environment Variable window will show, click the New button, and then enter the path that was shown when running the command above.
  6. Finally, restart Git Bash and try running “$ firebase login” again.

When I tried running it, I received the following error: Error: Cannot run login in non-interactive mode. See login:ci to generate a token for use in non-interactive environments.

Confused by the error message, I ran the following:

$ firebase login:ci

I received the following two errors:
Error: Cannot run login:ci in non-interactive mode.
Error: An unexpected error has occurred.

Further investigation led me to this command, which helped resolve the issue:

$ firebase login --interactive

You can than proceed with the prompt below and then authenticate into your Google account

Firebase -bash: firebase: command not found – Windows