3

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

firebase-functions@2.0.5 postinstall D:\Firebase\node_modules\firebase-functions

node ./upgrade-warning

======== 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 postinstall D:\Firebase\functions\node_modules\firebase-functions node ./upgrade-warning

======== 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. I check "package.json"

    "dependencies": { "firebase-admin": "~5.12.0", "firebase-functions": "^2.0.5" },

How can I update from firebase-admin@5.12.0 to firebase-admin@6.0.0 ?

Thanks very much.

Gene Bo
  • 11,284
  • 8
  • 90
  • 137
Jack Wilson
  • 6,065
  • 12
  • 29
  • 52
  • 1
    I think the tilde `~` in package.json before the version number is what is messing you up. It allows minor version number changes (middle number) only. see: https://stackoverflow.com/a/22345808/1291935 – DrCord Aug 16 '18 at 15:57
  • my package.json is in "D:\Firebase\functions" – Jack Wilson Aug 16 '18 at 15:58

2 Answers2

13

To get the latest version of any npm module for your Cloud Functions project:

cd functions
npm install firebase-admin@latest
Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
8

In my case, I kept running npm install and npm install firebase-admin@latest (as suggested in the warning message itself) under /[project]/functions and getting the same warning.

I realized I had forgotten to run this update:

npm install --save firebase-functions@latest

Gene Bo
  • 11,284
  • 8
  • 90
  • 137