npm ERR!缺少对等部门:firebase-functions@2.3.1所需的firebase-admin@^7.0.0 [英] npm ERR! peer dep missing: firebase-admin@^7.0.0, required by firebase-functions@2.3.1
问题描述
我正在尝试了解如何获取所需的 firebase-admin
版本.我的情况是这样的:
I am trying to understand how to get the version of firebase-admin
that is required. My scenario is this:
MYPATH\functions>npm list firebase-admin
functions@ MYPATH\functions
`-- UNMET PEER DEPENDENCY firebase-admin@6.5.1
npm ERR! peer dep missing: firebase-admin@^7.0.0, required by firebase-functions@2.3.1
运行 npm update firebase-admin
不会更改任何内容.
Running npm update firebase-admin
does not change anything.
package.json
包含以下行:
"dependencies": {
...
"firebase-admin": "^6.5.1",
我该怎么办?
更新:当执行 firebase服务
时,出现此错误:
! Your requested "node" version "6" doesn't match your global version "10"
....
+ hosting: Local server: http://localhost:5000
! 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)
推荐答案
'npm update'正在工作,但是package.json中针对"firebase-admin"的'^'克拉将更新限制为6.x发行版-因此它没有比6.5.1发行版更新的任何版本.
'npm update' is working, however the '^' carat against "firebase-admin" in your package.json will limit the updates to the 6.x releases - so it's not getting anything newer then the 6.5.1 release.
您可以在package.json中手动将"firebase-admin"的版本更改为"^ 7.0.0",然后运行"npm install".这将获取7.x.x范围内的最新版本.
You can manually change the version of "firebase-admin" in your package.json to "^7.0.0" and then run 'npm install'. This will grab the latest release in the 7.x.x range.
这篇关于npm ERR!缺少对等部门:firebase-functions@2.3.1所需的firebase-admin@^7.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!