firebase version is not updating through

前端 未结 6 1912
梦如初夏
梦如初夏 2021-02-05 08:14

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 sam

6条回答
  •  庸人自扰
    2021-02-05 08:33

    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

提交回复
热议问题