3
votes

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

[email protected] 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'

- [email protected] node_modules\compressible\node_modules\mime-db

- [email protected] node_modules\request\node_modules\mime-db

- [email protected] node_modules\request\node_modules\mime-types

D:\Firebase

+-- [email protected]

| +-- @google-cloud/[email protected]

| | +-- [email protected]

| | | `-- [email protected]

| | `-- [email protected]

| `-- @types/[email protected]

`-- [email protected]

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

[email protected] 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 [email protected]

`-- [email protected]

npm WARN [email protected] 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 [email protected] to [email protected] ?

Thanks very much.

2
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: stackoverflow.com/a/22345808/1291935 - DrCord
my package.json is in "D:\Firebase\functions" - Jack Wilson

2 Answers

11
votes

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

cd functions
npm install firebase-admin@latest
5
votes

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