【问题标题】:How can I update from firebase-admin@5.12.0 to firebase-admin@6.0.0?如何从 firebase-admin@5.12.0 更新到 firebase-admin@6.0.0?
【发布时间】:2019-01-23 15:26:47
【问题描述】:

1。 D:\Firebase>npm install firebase-functions@latest firebase-admin@latest --save

firebase-functions@2.0.5 安装后 D:\Firebase\node_modules\firebase-functions

节点./升级警告

======== WARNING! ========

This upgrade of firebase-functions contains breaking changes if you are upgrading from a version below v1.0.0.

To see a complete list of these breaking changes, please go to:

https://firebase.google.com/docs/functions/beta-v1-diff

npm WARN saveError ENOENT: no such file or directory, open 'D:\Firebase\package.json'

- mime-db@1.35.0 node_modules\compressible\node_modules\mime-db

- mime-db@1.35.0 node_modules\request\node_modules\mime-db

- mime-types@2.1.19 node_modules\request\node_modules\mime-types

D:\Firebase

+-- firebase-admin@6.0.0

| +-- @google-cloud/storage@1.7.0

| | +-- compressible@2.0.14

| | | `-- mime-db@1.35.0

| | `-- mime-types@2.1.19

| `-- @types/node@8.10.26

`-- firebase-functions@2.0.5

npm WARN enoent ENOENT: no such file or directory, open 'D:\Firebase\package.json'

npm WARN Firebase No description

npm WARN Firebase No repository field.

npm WARN Firebase No README data

npm WARN Firebase No license field.
  1. D:\Firebase\functions>npm install --save firebase-functions@latest

firebase-functions@2.0.5 安装后 D:\Firebase\functions\node_modules\firebase-functions 节点./升级警告

======== WARNING! ========

This upgrade of firebase-functions contains breaking changes if you are upgrading from a version below v1.0.0.

To see a complete list of these breaking changes, please go to:

https://firebase.google.com/docs/functions/beta-v1-diff

functions@ D:\Firebase\functions

+-- UNMET PEER DEPENDENCY firebase-admin@5.12.0

`-- firebase-functions@2.0.5

npm WARN firebase-functions@2.0.5 requires a peer of firebase-admin@~6.0.0 but none was installed.

~

  1. 我检查“package.json

    “依赖”:{ "firebase-admin": "~5.12.0", “firebase 功能”:“^2.0.5” },

如何从 firebase-admin@5.12.0 更新到 firebase-admin@6.0.0 ?

非常感谢。

【问题讨论】:

  • 我认为 package.json 中的波浪号 ~ 在版本号之前是什么让你搞砸了。它只允许次要版本号更改(中间号)。见:stackoverflow.com/a/22345808/1291935
  • 我的 package.json 在“D:\Firebase\functions”中

标签: firebase npm google-cloud-functions firebase-admin


【解决方案1】:

就我而言,我一直在 /[project]/functions 下运行 npm installnpm install firebase-admin@latest(如警告消息本身所建议的那样)并收到相同的警告。

我意识到我忘记运行此更新:

npm install --save firebase-functions@latest

【讨论】:

    【解决方案2】:

    要为您的 Cloud Functions 项目获取任何 npm 模块的最新版本:

    cd functions
    npm install firebase-admin@latest
    

    【讨论】:

      猜你喜欢
      • 2019-02-12
      • 2018-03-20
      • 2020-03-23
      • 2021-05-20
      • 2021-06-23
      • 2019-09-30
      • 1970-01-01
      • 2021-11-17
      • 2018-08-18
      相关资源
      最近更新 更多