In this post, we share with you how to install the firebase cli package to resolve the “firebase: command not found” error, along with the reason why we get this kind of error. Join us in this article to get more detailed information.
Why do we run into this problem?
The reason why you get the error message: “firebase: command not found” is because you don’t have package firebase cli installed. The above message means that the system cannot find the firebase command on your computer. To fix this problem, make sure you have installed the firebase cli package.
The solutions for the firebase: command not found error
The fastest way to fix this problem is to install the firebase cli package globally. To do that, open the terminal and run the command below:
npm install -g firebase-tools
Once the installation is complete, you can check the version you have just installed of the package with the following command:
firebase --version
Output:
10.0.1
In case you need more help, use the commands below:
::show a list of available commands
firebase --help
::give instructions for a specific command
firebase <command> --help
For installation, sometimes you also need to use administrator/superuser privileges. Don’t forget to restart the terminal before continuing to make sure to update with the latest changes.
If you perform the installation exactly as instructed above and the error still persists, run this command:
npm config get prefix
Output:
C:\Users\Admin\AppData\Roaming\npm
After executing this command, you receive a string which is the path to where ‘npm‘ locates all the global packages you have installed. You can then find those packages in the bin folder.
At this point, you need to check the PATH environment variable. If it doesn’t already have the same value as you got from the statement ‘npm config get prefix‘, then add that value for the PATH environment variable.
Note: If this approach also does not help, you must uninstall NodeJS from your computer and reinstall it. Then execute the command ‘npm install -g firebase-tools‘ to install the firebase cli package globally.
Summary
In conclusion, you must install the firebase cli package globally before using it in order not to avoid getting the firebase: command not found error. If you have problems with the installation, try following the same Path environment variable check steps we mentioned above. That’s the end of this post. We hope the above information is helpful to you.
You can read more other articles here, thanks for reading!
Maybe you are interested:
- Error “yarn: command not found”
- Webpack: command not found error
- Create-next-app: command not found error

My name’s Christopher Gonzalez. I graduated from HUST two years ago, and my major is IT. So I’m here to assist you in learning programming languages. If you have any questions about Python, JavaScript, TypeScript, Node.js, React.js, let’s contact me. I will back you up.
Name of the university: HUST
Major: IT
Programming Languages: Python, JavaScript, TypeScript, Node.js, React.js