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

3

7

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

Lawrencelawrencium answered 20/2, 2020 at 7:55 Comment(0)
L
18

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

Lawrencelawrencium answered 21/2, 2020 at 4:38 Comment(3)
This helped me as well. I had a fresh install where I used the firebase cURL installation instructions. Switching to npm made it work properly.Democratize
for me just reinstalling firebase-tools with npm i -g firebase-tools fixed the issue. thanks for the tip!Wye
Running nvm use 14 (or whatever version you want) helped solve things for me in addition to reinstalling firebase toolsLoper
U
1

Open a new terminal and use nvm to set the version you need npm use 12. Finally, install the packages again with npm install.

Unflinching answered 21/10, 2021 at 20:37 Comment(0)
A
0

Use brew list --versions node to check if you installed node using brew.


In my case, I had installed a package called mongosh using Homebrew. This package depended on node, so brew installed node as well.

So, I had brew node and nvm node.

Firebase kept trying to use my brew node when I wanted it to use the nvm node.

I never figured out how to tell firebase to use nvm node, but simply uninstalling mongosh and subsequently node from brew forced Firebase to look at my nvm node runtime.

Asir answered 23/8, 2024 at 22:23 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.