Cloud Functions 模拟器需要模块“firebase-admin";要安装 [英] The Cloud Functions emulator requires the module "firebase-admin" to be installed
问题描述
继续尝试让 firebase serve
再次工作.我刚刚问了这个问题(得到了很好的答复,谢谢):npm 错误!peer dep 缺失:firebase-admin@^7.0.0,firebase-functions@2.3.1 需要
Continuing to try to get firebase serve
to work again. I just asked this question (and got a good reply, thanks):
npm ERR! peer dep missing: firebase-admin@^7.0.0, required by firebase-functions@2.3.1
在执行 npm list firebase-admin
时,我现在看到了预期的输出 -- firebase-admin@7.3.0
.
When doing npm list firebase-admin
I now see the expected output -- firebase-admin@7.3.0
.
但是 firebase serve
仍然不起作用.我明白了:
However firebase serve
still does not work. I get this:
! 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-admin
模块.到底是怎么回事?我该怎么办?
So firebase serve
still does not see the firebase-admin
module. What is going on? What should I do?
推荐答案
我看到了同样的东西,看起来你可以 将你的firebase-tools版本降级到6.8.0
I was seeing the same thing and it looks like you can downgrade your firebase-tools version to 6.8.0
npm install firebase-tools@6.8.0 -g
(我试过了,效果很好)
(I've tried this and it works)
这篇关于Cloud Functions 模拟器需要模块“firebase-admin";要安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!