'How to downgrade firebase versions

I am following a tutorial with React.js and Firebase and since the tutorial is from 2020 I believe he is using firebase version 8 or 9. I have never used firebase before and was following this tutorial step by step to try to gain some knowledge on it. I realized after getting a bunch of errors that I am using firebase 10.1.0 and a lot of things syntax has changed between the versions. I would like to just downgrade to version 8 so I can still follow along the tutorial the same but am having a lot of issues doing so.

so far I have tried these commands:

npm i -S firebase@9
npm i -S [email protected]

npm uninstall firebase
npm install --save [email protected]

After running all of these separately and checking the version (with firebase --version) in between no matter what it still says I am running version 10.1.0

Does anyone know what I am doing wrong or what I can do differently to downgrade this?



Solution 1:[1]

If you want to use the v8 syntax with the latest SDK versions, you can import the compat paths as explained here. That should make most existing tutorials out there work as is.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Frank van Puffelen