Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve Firebase emulator Node version warning?

What is the correct way to update Firebase Emulators after upgrading your local Node version?

After recently updating Node, the Firebase emulator throws the following warning when starting up:

Your requested "node" version "16" doesn't match your global version "18". Using node@18 from host.

The emulators still run without issue, but I'd like to prevent the warning going forward.

So far I've tried:

  • Deleting the yarn/package.lock file + node_modules
  • Then (re)running firebase init
    • Firebase docs: "This command starts a configuration wizard that lets you select emulators of interest, download the corresponding emulator binary files..."
    • Also suggested in this question
  • Then reinstalling the npm modules (i.e., yarn / npm -i)
like image 516
warfield Avatar asked Jul 17 '26 02:07

warfield


1 Answers

Inside the functions folder there is a package.json file with a declared "engine" version like so:

  "engines": {
    "node": "16"
  },

This lets you specify what version of Node the code will execute as. See this link for more info about the engines property: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#engines

To suppress the warning you can specify a version that matches your current Node version or use an asterisk. For me it looks like this:

node --version

v18.13.0

  "engines": {
    "node": ">=18"
  }
like image 120
Chris Avatar answered Jul 21 '26 21:07

Chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!