Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node version mismatch log possibly incorrect #2791

Closed
samtstern opened this issue Nov 6, 2020 · 10 comments · Fixed by #4583
Closed

Node version mismatch log possibly incorrect #2791

samtstern opened this issue Nov 6, 2020 · 10 comments · Fixed by #4583
Labels
emulator-suite polish Small feature requests

Comments

@samtstern
Copy link
Contributor

I am also getting this warning with the Firebase Emulator. I have a minimal reproduction at https://github.com/jthegedus/firebase-emulator-warning-reproduction with a GitHub Action demonstrating the issue.

The short of it is this:

The emulator runs, but I am unsure if the code is actually running in Node 12 or if this is a just a logging and detection error 🤷

Originally posted by @jthegedus in #1489 (comment)

@yulkin2002
Copy link

I am getting the same error

@alexkirmse
Copy link

@samtstern There seems to be different behavior depending on how firebase tools is installed. If you use the standalone binary it shows the log message but with the npm install method it doesn't.

I suspect that the standalone binary is bundled with node 12 (via firepit ?) so when checking what version node firebase tools is running, its using the embedded node (12) instead of the locally installed version?

@yuchenshi
Copy link
Member

@alexkirmse Yes, the standalone binary comes with a version of Node.js bundled. If that version doesn't work for you, please use the npm installation method instead

@alexkirmse
Copy link

@yuchenshi Makes sense. I brought this up specifically with this specific error:

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

I think the reason there's a mismatch is that the global version comes from the bundled nodejs regardless of what's set in package.json as the engine. With bug reports, it might be interesting to ask how firebase-tools was installed npm or binary.

@coffeepostal
Copy link

I think I'm having a related issue, I'm running the latest version of firebase-tools on Mac, and my system is running Node v16.13.2, but I'm getting the error Your requested "node" version "16" doesn't match your global version "12". Using node@12 from host. when I serve firebase. Everything I can find says to change the engines entry in package.json, but it's set to '16', so that's not the issue. It's breaking the tutorial I'm following, and it seems like most people aren't having this issue, but it's definitely a Node version issue. Any suggestions on how to get firebase to run v16 rather than v12 would be great!

@alexkirmse
Copy link

@coffeepostal Did you install firebase-tools via the binary or npm?
If you installed via binary try deleting it and installing via npm. Since the binary ships with it's own node and seems to be at 12.

@coffeepostal
Copy link

@alexkirmse I installed via npm, and just updated it to the most recent version. I might try reinstalling regardless.

@drmanojgrg
Copy link

no solving yet

@matzeso
Copy link

matzeso commented May 17, 2022

I had the same issue my code was not running since it required at least node 16 but running emulators ran with node12. It took me quite a while to figure this out. I think it would be really beneficial for the developer if the message could include the fact that the "host" system node@12 is not really coming from the host but from the binary.

yuchenshi added a commit that referenced this issue May 24, 2022
* Improve Node.js version warning for standalone. Fix #2791.

* Add changelog.

* Move generic message to else branch.

* Update CHANGELOG.md

Co-authored-by: Bryan Kendall <bkend@google.com>

Co-authored-by: Bryan Kendall <bkend@google.com>
@zerolethanh
Copy link

if you use nvm for packages manager, you must check firebase command belongs to nvm of using node.

$ which firebase
/Users/thanhle/.nvm/versions/node/v16.17.0/bin/firebase // this is ok

if not, you must install firebase-tools:
npm i -g firebase-tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emulator-suite polish Small feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants