使用npm i -g firebase-tools
升级到 8.4.0 后,将显示以下内容:
npm WARN notsup Unsupported engine for google-auth-library@6.0.0: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: google-auth-library@6.0.0
npm WARN notsup Unsupported engine for gaxios@3.0.3: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: gaxios@3.0.3
npm WARN notsup Unsupported engine for gcp-metadata@4.1.0: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: gcp-metadata@4.1.0
npm WARN notsup Unsupported engine for gtoken@5.0.1: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: gtoken@5.0.1
npm WARN notsup Unsupported engine for google-p12-pem@3.0.1: wanted: {"node":">=10"} (current: {"node":"8.16.2","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: google-p12-pem@3.0.1
我应该怎么做才能解决这个问题?
随着Firebase CLI 8.4.0的发布,似乎发生了很多变化,包括新的本地模拟器UI。 在这些更改中,有一些模块现在需要最低节点版本为 10。 这就是错误消息所说的:
不支持module@version引擎:需要:{"节点":">=10"}
如果您的本地节点版本小于 10,您将看到这些错误。 是时候升级节点版本了。 如果您使用的是 nvm,则只需键入nvm install 10
即可。 这不会影响部署时云函数的目标节点版本。 用于部署的节点版本仍在您的 package.json 中声明。