As per https://cloud.google.com/functions/docs/writing/ , Firebase Cloud Functions uses Node v6.11.5
Is there any insight as to why such an old version was chosen, especially considering that it makes me to unable to use newer syntax in JS languages like ECMA6?
EDIT: As of Cloud Next 2018, Cloud Functions has exited beta. There is node 8 support now, but it is currently in beta.
There are a number of things to keep in mind.
Cloud Functions will only use a version of node with LTS (Long Term Support). Only even number versions of node receive LTS.
Cloud Functions is in beta, and the engineering team has more important priorities than providing a new version of node. It's a priority to get to production readiness, and that doesn't necessarily involve having the latest version of node.
It's not feasible to simply drop in a new major version, as that might break existing clients. It will probably have to be the case that each project can select the version of node they would like to use, and that's a significant change.
You are able to use any language that you want that can transpile to ES6. This includes TypeScript and even Kotlin, if you wish. The Firebase CLI supports TypeScript directly, and has for a few months now. TypeScript is actually the Firebase team's recommended development language.
If you want to stay on top of the latest languages for Cloud Functions development, I strongly recommend that you not depend on the version of node. Instead, select tooling that can transpile to ES6.
Node 6 + 8 support is deprecated. The latest firebase-tools
now adds the following to functions/package.json
, if you don't have it you can add it:
"engines": { "node": "12" }
Note that this is the stable version at the time of writing but 14
is already in beta and can be used: https://firebase.google.com/docs/functions/manage-functions
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