36

i am windows user and trying to update firebase version using npm install -g firebase-tools but when i run firebase --version it shows the same version. I also run npm uninstall firebase --save and check firebase --version it shows same. what should i do to update my firebase version?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Farrukh Hanif
  • 361
  • 1
  • 3
  • 4

9 Answers9

29

npm update -g firebase-tools

or

npm install -g firebase-tools@3.12.0 to install a specific version

And make sure to restart your terminal/IDE otherwise, it won't take effect.

Pramesh Bajracharya
  • 2,153
  • 3
  • 28
  • 54
Alan
  • 1,510
  • 1
  • 18
  • 35
  • 2
    The restart tip was the missing piece of the puzzle - Highly frustrating popular IDEs don't automatically reload bash configurations. Thank you! – Nunnsy Jun 12 '22 at 12:38
10

Have you tried npm update -g firebase-tools? This worked for me.

Pramesh Bajracharya
  • 2,153
  • 3
  • 28
  • 54
6

These days if you're on an older version, and you check the version of firebase-tools, by running:

firebase -V

along with the version of firebase-tools that you're on, it also gives you a messages, something like this:

enter image description here

So you can basically run npm i -g firebase-tools to update the version of your firebase-tools installation to the latest version.

Hope this helps :)

SiddAjmera
  • 38,129
  • 5
  • 72
  • 110
  • 3
    With `npm install -g firebase-tools` I am getting `npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142` Any suggestion? Thanks! – Tulon Jul 14 '20 at 03:29
3

That might happen in case you've installed the firebase-cli using a so called automatic install script.

Try to call curl -sL https://firebase.tools | upgrade=true bash as described in the official documentation

Alexey Shikov
  • 1,730
  • 1
  • 12
  • 11
1

For other like me stumbling in with a weird version mismatch:

When I did firebase -V in my terminal I would get a different version (5.1.1) than when I ran firebase through a npm run script (3.19.3)

The problem was that I had previously installed firebase locally into that project. In other words, I was getting the global version in the terminal, but npm was using the node_modules version

To confirm this, I added a simple test called test-foo to my package.json (firebase -V && which firebase) and ran it:

kuzyn(λ)matebox‡ npm run test-foo
kuzyn-project@1.1.0 test-foo /home/kuzyn/code/kuzyn-project/firebase
firebase -V && which firebase
3.19.3
/home/kuzyn/code/kuzyn-project/firebase/node_modules/.bin/firebase

Then I removed the (uneeded in my case) local firebase package from the package.json and from node_modules

kuzyn
  • 1,905
  • 18
  • 30
0

Try the 2 steps bellow 1. yarn/npm cache clean 2. npm install -g firebase firebase-tools or yarn add -g firebase firebase-tools in a new terminal, firebse --version works for me

D. Mohamed
  • 75
  • 1
  • 4
0

it works to me... standalone binary: Download the new version, then replace it on your system if you are using the standalone.Download the new version

Rony Man
  • 59
  • 4
0

In my case I was using an old node version (v10) and had to switch to a newer one (v12). After that I ran npm install -g firebase-tools again and it was updated to the latest version.

You can check the current node version by running node -v. And I use nvm to switch to a different node version.

Nil
  • 129
  • 4
  • 11
0

I tried several ways too and found this solution. I hope I helped to solve your problem.

 curl -sL https://firebase.tools | upgrade=true bash