我创建了一个 firebase 云函数项目,它默认添加了以下依赖项和以下引擎:
"dependencies": {
"firebase-admin": "^8.0.0",
"firebase-functions": "^3.1.0"
},
"engines": {
"node": "8"
}
每当我运行
yarn add
我收到以下错误并且未添加依赖项:error firebase-admin@8.4.0: The engine "node" is incompatible with this module. Expected version "^8.13.0 || >=10.10.0". Got "8.11.4"
然后我尝试将 Node 引擎版本更改为 10
"engines": {"node": "10"}
,但是现在当我添加 yarn 时出现以下错误:error functions@: The engine "node" is incompatible with this module. Expected version "10". Got "8.11.4"
如何解决这个问题呢?
最佳答案
有一个Github issue它解决了您遇到的问题。总而言之,您可以:
yarn config set ignore-engines true
node -v
中的版本和 npm -v
匹配 package.json
中列出的版本如果没有,请更新以匹配预期版本 关于node.js - firebase 云功能引擎 Node 与此模块不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57715031/