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
- You need to make sure your npm prefix has been added to your environment variables. Run the following:
- 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.
- Then, in the System Variables area, find the PATH variable, select it, and click Edit.
- The Edit Environment Variable window will show, click the New button, and then enter the path that was shown when running the command above.
- Finally, restart Git Bash and try running “$ firebase login” again.
$ npm get prefix
Mine was “C:\Users\
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