将云功能更新为合适的Node js版本 [英] Updating cloud function to suitable Node js version
本文介绍了将云功能更新为合适的Node js版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
firebase FCM通知的云功能在Node.js 8的早期版本上运行良好,但是现在不赞成使用节点8,并且需要对其进行更新,我应该对云功能代码进行哪些更改,我已经在我的机器上安装了Nodejs 14 *
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
推荐答案
您绝对需要进行的唯一更改完全不在您的代码中.至少应编辑package.json并确保目标节点版本为10:
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"
},
只需重新部署该函数即可使用节点10运行时.
Simply redeploy the function to use the node 10 runtime.
这篇关于将云功能更新为合适的Node js版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文