I am trying to launch cloud functions based on this tutorial https://www.youtube.com/watch?v=UDMDpdu5-rE. When I try to run firebase emulators:start
I get Failed to load function definition from source: FirebaseError: package.json in functions directory has an engines field which is unsupported. Valid choices are: {"node": 10|12|14|16}
. How can I resolve this issue? I updated everything following the guide https://firebase.google.com/docs/functions/get-started
npm install firebase-functions@latest firebase-admin@latest --save
npm install -g firebase-tools
only with yarn instead of npm. Still I get the same error. Firebase version seems to be at firebase-tools@11.24.1
I figured it out by trying out some things from Does Firebase Function Does not Support Node 18 as its Engine parameter in Package.json file?. For some reason in package.json the value "engines": {"node": ">= 16"}
produced this behavior. Setting it to "engines": {"node": "18"}
resolves the issue.