Search code examples
node.jsfirebasenvmfirebase-cli

Firebase shell still reads my Node version 12 instead of the Nvm version


My problem is a bit tedious and need the community to help me out here. I installed node 12 from the official site of Nodejs.org using it's .pkg file. I use firebase functions shell to test our work locally, but due to version conflicts I need to downgrade to 10. This is where the problems start, I installed NVM to get the downgraded version, and I was successful, so when I do node -v I see the v10 but when I run

firebase functions:shell

I still get the warning

Your requested "node" version "10" doesn't match your global version "12"

Now I need to get this sorted because my local cloud functions still don't work and I think it's still reading the 12th version of the node. I've followed different tutorials of manually deleting node from your system and again I was able to delete Node by verifying

node -v it gave me an error of node command not found which means Node was deleted, but even though Node uninstalled I still was able to run

firebase functions:shell and run the cloud function locally, so it means node 12 is still in the system but I can't seem to uninstall it.

So any help in this would be really appreciated.

Thanks


Solution

  • I was able to solve this using the following ways

    1. Delete firebase from the global directory in the root folder. So I wrote which firebase and it gave me a location on the root folder. I deleted that firebase instance.

    2. Then I installed firebase using npm i -g firebase-tools this was installed directly into my nvm version of the node.

    Only after that I was able to run firebase on the node version which I was using on the nvm