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:
yarn/package.lock file + node_modulesfirebase init
yarn / npm -i)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"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With