I am trying to install firebase in my fresh react project, I could not able to install it.
Whether it is an error or the npm is taking time. I am waiting for more than half an hour.
Try this (you may need to run sudo
or if you're on Windows, open cmd
as Admin)..
npm cache clean --force
then run
npm install firebase
while the above answer seems to work for most cases it wasn't true for my case. I tried
npm cache clean -f
npm install firebase
no luck!
I followed this thread which explained a lot about npm caches which also concluded the above method should work and maybe to just verify cache before installing firebase
npm cache clean -f
npm install firebase
npm verify cache
still, no luck so I just decided to add it in package.json as a dependency with the latest stable version of firebase (8.0.0) at this time.
so go to package.json file and in the dependencies section
"dependencies": {
"firebase": "^8.0.0",
...other dependencies
}
and do
npm cache clean -f
npm install npm@latest
this should work for similar cases check out this link to see how caching on npm works in detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With