I’m trying to build an app with Firebase and ran a few commands to see which version I have. To follow along with a 2021 instruction video, I was hoping to have Firebase v9. Depending on the command that I run, I somehow have versions 8 and 11. If I have these two versions, which one is actually being used? What is the difference between seemingly having an npm firebase and non-npm firebase installed?
armadillo@armadillo-MacBook-Air my-app % npm firebase --version
8.11.0
armadillo@armadillo-MacBook-Air my-app % firebase -V
11.2.2
2
Answers
If you’re trying to work with the Firebase CLI, you should be looking at the firebase-tools npm package, not firebase. They are definitely not the same thing.
I suggest reviewing the documentation as well.
As covered by @Doug‘s answer, the
firebase
command is defined by thefirebase-tools
npm package (or by https://firebase.tools if installed that way) not thefirebase
package, which does not define any command line utilities.Additionally,
npm --version
returns the version ofnpm
you have installed. This includes if you add the name of a package there. (i.e.npm thisCouldBeAnythingNotANPMCommand --version
will return the same result)If you want to view the version of a deployed package, you would use one of the following commands to query NPM’s database:
If you want to view the version of a package installed in your project or globally, you would use:
If you want to view the where the npm-installed commands are, you would use:
For the
firebase
command, thefirebase
/firebase.cmd
/firebase.ps1
files all point to<global bin directory>/node_modules/firebase-tools/lib/bin/firebase.js
.Compare the results of: