使用 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 的发布,似乎发生了很多变化,包括新的 local emulator UI .在这些更改中,一些模块现在需要最低 Node 版本 10。这就是错误消息所说的:
Unsupported engine for module@version: wanted: {"node":">=10"}
如果您的本地 Node 版本小于 10,您将看到这些错误。是时候升级你的 Node 版本了。如果您使用的是 nvm,只需键入
nvm install 10
.这不会影响部署时 Cloud Functions 所针对的 Node 版本。部署的 Node 版本仍然在你的 package.json 中声明。
关于node.js - 将 Firebase CLI 更新到 8.4.0 会出现关于 "Unsupported engine"的错误,说 '{" Node “:">=10"}”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61943139/