![](/img/trans.png)
[英]The Cloud Functions emulator requires the module “firebase-admin” to be version >7.0.0 so your version is too old
[英]The Cloud Functions emulator requires the module "firebase-admin" to be installed
继续尝试让firebase serve
再次工作。 我刚刚问了这个问题(并得到了很好的答复,谢谢): npm ERR:peer dep missing。 firebase-admin@^7.0,0. firebase-functions@2.3.1 要求
在执行npm list firebase-admin
时,我现在看到预期的 output -- firebase-admin@7.3.0
firebase-admin@7.3.0 。
但是firebase serve
仍然不起作用。 我明白了:
! Your requested "node" version "6" doesn't match your global version "10"
...
! The Cloud Functions emulator requires the module "firebase-admin" to be installed. This package is in your package.json, but it's not available. You probably need to run "npm install" in your functions directory.
i functions: Your functions could not be parsed due to an issue with your node_modules (see above)
所以firebase serve
仍然没有看到 firebase firebase-admin
模块。 到底是怎么回事? 我应该怎么办?
现在看来这个问题与您在本地安装的 Node 版本有关。
我不知道我的头顶上的答案,但开始环顾节点版本。
在您的 functions/package.json - 您可能需要指定要使用的节点版本( https://firebase.google.com/docs/functions/manage-functions ):
// functions/package.json { "name": ..., "scripts": ..., "dependencies": ..., "engines": { "node": "10" } }
请注意,Node 10 在 Firebase 上仍处于测试阶段。
基本上这意味着您应该降级到节点 6 或 8,而不是升级到 10(因为系统中的节点版本是 10,而 Firebase 请求版本 6)。 Firebase 尚不支持 Node 10+ 甚至最新版本 12.15.0
打开终端并进入您的/myProject/functions文件夹。
然后,运行npm install
所有必需的模块都应出现在node_modules文件夹中。
删除
node_module<\/code>文件夹。
在包含
package.json<\/code>的目录中再次运行
npm install<\/code> 。
这解决了我的问题。
"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.