【问题标题】:npm ERR! peer dep missing: firebase-admin@^7.0.0, required by firebase-functions@2.3.1npm 错误!缺少对等部门:firebase-admin@^7.0.0,firebase-functions@2.3.1 需要
【发布时间】:2019-09-27 19:30:51
【问题描述】:

我正在尝试了解如何获取所需的 firebase-admin 版本。我的情况是这样的:

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 不会改变任何东西。

package.json 包含这一行:

"dependencies": {
  ...
  "firebase-admin": "^6.5.1",

我该怎么办?

更新: 在执行firebase serve 时出现此错误:

!  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)

【问题讨论】:

    标签: firebase npm google-cloud-functions


    【解决方案1】:

    'npm update' 正在工作,但是 package.json 中针对“firebase-admin”的 '^' 克拉会将更新限制为 6.x 版本 - 所以它不会比 6.5.1 版本更新.

    您可以手动将 package.json 中的“firebase-admin”版本更改为“^7.0.0”,然后运行“npm install”。这将获取 7.x.x 范围内的最新版本。

    【讨论】:

    猜你喜欢
    • 2019-02-12
    • 2017-11-23
    • 1970-01-01
    • 2020-06-15
    • 2018-08-05
    • 1970-01-01
    • 2018-06-17
    • 2019-09-27
    • 1970-01-01
    相关资源
    最近更新 更多