gpt4 book ai didi

Node.js 版本和 Google Cloud 功能

转载 作者:IT老高 更新时间:2023-10-28 23:15:35 26 4
gpt4 key购买 nike

当我使用 firebase serve 启动本地 Firebase 服务器时收到此消息:

Warning: You're using Node.js v8.9.4 but Google Cloud Functions only supports v6.11.5.

但是没有关于做什么的信息。我需要做什么才能将 Node.js 降级到 v6.11.5?我应该将该版本仅用于 Firebase 项目,而将最新发布的 Node.js 版本用于其他项目吗?那我该怎么做呢?


编辑:警告现在看起来像这样,我无法运行一个几乎为空的新项目:

Warning: You're using Node.js v8.9.4 but Google Cloud Functions only supports v6.11.5.
! functions: Failed to load functions source code. Ensure that you have the latest SDK by running npm i --save firebase-functions inside the functions directory.
! functions: Error from emulator. mod.hasOwnProperty is not a function

所以我真的认为我必须降级 Node.js。但我不知道如何安全地做到这一点。嗯,看着http://nodejs.org/我什至找不到v6.11.5版本?


编辑 2:如果 npm update --dev 解决了问题,只需 checkin 新项目。它没。 (实际上没有更新的包。)

最佳答案

这只是一个警告。如果你知道你在做什么,你可以忽略它。它告诉您,您的函数的本地仿真(在 Node 8.9.4 上运行)可能与该函数在部署到 Cloud Functions(运行 6.11.5)时将执行的操作不完全匹配。但只要您不使用 Node 6.11.5 上不可用的任何 Node 功能,就不会出现问题。我一直使用较新版本的 Node 在本地进行测试,没有问题。

关于Node.js 版本和 Google Cloud 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50001512/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com