Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating cloud function to suitable Node js version

The cloud function for the firebase FCM notification which was working fine with the earlier version of Node.js 8 but now as the node 8 is deprecated and needs to be updated, what changes should I make to the cloud function code, I have already installed Nodejs 14* on my machine


1 Answers

The only change you're absolutely required to make is not in your code at all. Minimally, you should edit your package.json and make sure that the target node version is 10:

  "engines": {
    "node": "10"
  },

Simply redeploy the function to use the node 10 runtime.

Read more about migrating your functions to node 10.

like image 123
Doug Stevenson Avatar answered Jul 17 '26 17:07

Doug Stevenson



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!