firebase version is not updating through <npm install -g firebase-tools>

大兔子大兔子 提交于 2019-12-03 02:09:24
Alan

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.

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

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!