19

From the node.js command prompt, using:

$ firebase help

gives this list:

Usage: firebase [options] [command]

Options:
--------


 - -V, --version - output the version number
 - -P, --project <alias_or_project_id> - the Firebase project to use for this command
 - -j, --json - output JSON instead of text, also triggers non-interactive mode   --token <token> - supply an auth token for
   this command
 - --non-interactive - error out of the command instead of waiting for prompts
 - --interactive - force interactive shell treatment even when not detected
 - --debug - print verbose debug output and keep a debug log file
 - -h, --help - output usage information

Commands:
---------

 - auth:import [options] [dataFile]           import users into your
   Firebase project from a data file(.csv or .json)
 - auth:export [options] [dataFile]           Export accounts from your
   Firebase project into a data file
 - database:get [options] <path>              fetch and print JSON data
   at the specified path
 - database:push [options] <path> [infile]    add a new JSON object to a
   list of data in your Firebase
 - database:set [options] <path> [infile]     store JSON data at the
   specified path via STDIN, arg, or file
 - database:remove [options] <path>           remove data from your
   Firebase at the specified path
 - database:update [options] <path> [infile]  update some of the keys
   for the defined path in your Firebase
 - database:profile [options]                 profile the Realtime
   Database and generate a usage report
 - firestore:delete [options] [path]          Delete data from Cloud
   Firestore.
 - firestore:indexes [options]                List indexes in your
   project's Cloud Firestore database.
 - deploy [options]                           deploy code and assets to
   your Firebase project
 - hosting:disable [options]                  stop serving web traffic
   to your Firebase Hosting site
 - functions:log [options]                    read logs from deployed
   functions
 - functions:shell [options]                  launch full Node shell
   with emulated functions
 - functions:config:clone [options]           clone environment config
   from another project
 - functions:config:get [path]                fetch environment config
   stored at the given path
 - functions:config:set [values...]           set environment config
   with key=value syntax
 - functions:config:unset [keys...]           unset environment config
   at the specified path(s)
 - functions:delete [options] [filters...]    delete one or more Cloud
   Functions by name or group name.
 - experimental:functions:shell [options]     launch full Node shell
   with emulated functions. (Alias for `firebase functions:shell.)
 - help [command]                             display help information
 - init [feature]                             setup a Firebase project
   in the current directory
 - list                                       list the Firebase projects
   you have access to
 - login [options]                            log the CLI into Firebase
 - login:ci [options]                         generate an access token
   for use in non-interactive environments
 - logout                                     log the CLI out of
   Firebase
 - open [link]                                quickly open a browser to
   relevant project resources
 - serve [options]                            start a local server for
   your static assets
 - setup:web                                  display this project's
   setup information for the Firebase JS SDK
 - setup:emulators:database                   downloads the database
   emulator
 - setup:emulators:firestore                  downloads the firestore
   emulator
 - target [type]                              display configured deploy
   targets for the current project
 - target:apply <type> <name> <resources...>  apply a deploy target to a
   resource
 - target:clear <type> <target>               clear all resources from a
   named resource target
 - target:remove <type> <resource>            remove a resource target
 - tools:migrate [options]                    ensure your firebase.json
   format is up to date
 - use [options] [alias_or_project_id]        set an active Firebase
   project for your working directory

To get help with a specific command, type firebase help [command_name]

$ firebase -V

Gives a version number, but I don't know if it's the version number of Firebase Tools.

The only command for tools is:

tools:migrate [options]

Which is to: ensure your firebase.json format is up to date

How do I get the current version of firebase tools?

Alan Wells
  • 30,746
  • 15
  • 104
  • 152
  • I wrote how to upgrade below. But what output *do* you get when you run `firebase -V`? Do any other commands work? – Frank van Puffelen Dec 04 '18 at 14:27
  • The command $ `firebase -V` displays "6.1.1" The node version is "6.11.5" which shows up automatically when the node command prompt window is opened. – Alan Wells Dec 04 '18 at 15:18
  • After updating the firebase tools, and running $ `firebase -V` again, the version number given matched the version number after updating tools. So, $ firebase -V command must give the version number of Firebase Tools. I didn't realize that. I thought it could be a version number of something else. – Alan Wells Dec 04 '18 at 15:39

4 Answers4

28

Try running :

 firebase tools --version
Fakebounce
  • 667
  • 4
  • 17
24

The flags -V and --version outputs the version number for firebase-tools. So to determine the current version, run:

firebase --version

To upgrade Firebase tools to the latest version, run:

npm upgrade firebase-tools -g
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Running `npm upgrade firebase-tools -g` ran an update and displayed `-- firebase-tools@6.1.2` But, I wanted to know my current version before updating. So, if I don't want the most recent version, I now need to revert back somehow, and that's what I wanted to avoid. – Alan Wells Dec 04 '18 at 15:26
  • 1
    I just realized that the command $ `firebase -V` *does* give the version number of Firebase Tools. After updating to 6.1.2 I ran $ `firebase -V` again, and it displayed 6.1.2 and previously it displayed 6.1.1 – Alan Wells Dec 04 '18 at 15:42
  • Ah, I see that you your question. I'll update my answer, but I'm also just happy you got it sorted. – Frank van Puffelen Dec 04 '18 at 18:40
  • CAUTION: This doesn't answer the question, but instead changes your system. The correct answer is the one by Fakebounce (firebase tools --version). Any other answer (at the time of writing) is more correct than this. – Jay Querido May 22 '20 at 13:57
6

Run firebase tools --version to check version.

And as per the prompt, run npm install -g firebase-tools to update.

enter image description here

Update

You're right. It looks like it matches the version numbers of this library, but not another.

FiringBlanks
  • 1,998
  • 4
  • 32
  • 48
  • I have installed Firebase via Yarn, after installing when I check the version using the command suggested here, I see: command not found: firebase. Any ideas what is going wrong? – harshikerfuffle Aug 08 '22 at 12:07
4

New Answer on 2019-Dec-1

Just do firebase --version it will give you the version number enter image description here

Sky
  • 2,212
  • 3
  • 14
  • 22
  • But if an upgrade is available, this doesn't tell you, unlike `firebase tools --version`. Are there some other benefits of using `firebase --version` besides not having to type the "tools" in the middle? – auspicious99 Jul 19 '20 at 03:26
  • Since it only outputs the number and nothing else, it's useful for scripting. – dta Dec 05 '20 at 17:22