【问题标题】:How do I find out what the current version of Firebase Tools is如何找出当前版本的 Firebase 工具是什么
【发布时间】:2019-05-06 00:00:52
【问题描述】:

在 node.js 命令提示符下,使用:

$ firebase help

给出这个列表:

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

要获取特定命令的帮助,请输入 firebase help [command_name]

$ firebase -V

给出版本号,但我不知道是不是 Firebase 工具的版本号。

工具的唯一命令是:

工具:迁移 [选项]

这是为了: 确保您的 firebase.json 格式是最新的

如何获取当前版本的 firebase 工具?

【问题讨论】:

  • 我在下面写了如何升级。但是当您运行firebase -V 时,您会得到什么输出?其他命令有用吗?
  • 命令$firebase -V显示“6.1.1”节点版本为“6.11.5”,打开节点命令提示符窗口时自动显示。
  • 更新firebase工具后,再次运行$firebase -V,给出的版本号与更新工具后的版本号一致。所以,$ firebase -V 命令必须给出 Firebase 工具的版本号。我没有意识到这一点。我认为它可能是其他东西的版本号。

标签: firebase google-cloud-functions firebase-hosting firebase-tools


【解决方案1】:

尝试运行:

 firebase tools --version

【讨论】:

    【解决方案2】:

    标志-V--version 输出firebase-tools 的版本号。所以要确定当前版本,运行:

    firebase --version
    

    要将 Firebase 工具升级到最新版本,请运行:

    npm upgrade firebase-tools -g
    

    【讨论】:

    • Running npm upgrade firebase-tools -g 运行更新并显示-- firebase-tools@6.1.2 但是,我想在更新之前知道我当前的版本。所以,如果我不想要最新版本,我现在需要以某种方式恢复,这就是我想要避免的。
    • 我刚刚意识到命令 $ firebase -V 确实给出了 Firebase 工具的版本号。更新到 6.1.2 后,我再次运行 $firebase -V,它显示 6.1.2,之前它显示 6.1.1
    • 啊,我明白你的问题了。我会更新我的答案,但我也很高兴你把它整理好了。
    • 注意:这并不能回答问题,而是会改变您的系统。正确答案是 Fakebounce (firebase tools --version) 的答案。任何其他答案(在撰写本文时)都比这更正确。
    【解决方案3】:

    运行firebase tools --version 来检查版本。

    并根据提示运行npm install -g firebase-tools进行更新。

    更新

    你是对的。看起来它与 this library 的版本号匹配,但不是另一个。

    【讨论】:

      【解决方案4】:

      2019 年 12 月 1 日的新答案

      只要firebase --version 它会给你版本号

      【讨论】:

      • 但是如果升级可用,这不会告诉你,不像firebase tools --version。除了不必在中间输入“工具”之外,使用firebase --version 还有其他好处吗?
      • 因为它只输出数字而不输出其他任何东西,所以它对脚本很有用。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-20
      • 2010-10-22
      • 2020-10-13
      • 1970-01-01
      • 2013-02-12
      • 2022-01-16
      相关资源
      最近更新 更多