简体   繁体   中英

Error peer dependencies for @firebase/database in cloud functions using firebase-admin

I have some functions that use the firebase-admin package.

I don't know exactly when, but at some point I started to get some npm WARNING's:

npm WARN @firebase/database@0.4.12 requires a peer of @firebase/app@0.x but none is installed. You must install peer dependencies yourself.
npm WARN @firebase/database@0.4.12 requires a peer of @firebase/app-types@0.x but none is installed. You must install peer dependencies yourself.
npm WARN @firebase/database-types@0.4.2 requires a peer of @firebase/app-types@0.x but none is installed. You must install peer dependencies yourself.

So in firebase-admin 's package.json file, there is:

"dependencies": {
    "@firebase/database": "^0.4.7",
    "@google-cloud/firestore": "^2.0.0",
    "@google-cloud/storage": "^3.0.2",
    "@types/node": "^8.0.53",
    "dicer": "^0.3.0",
    "jsonwebtoken": "8.1.0",
    "node-forge": "0.7.4"
  },

And in @firebase/database 's package.json , there is:

"peerDependencies": {
    "@firebase/app": "0.x",
    "@firebase/app-types": "0.x"
  },

But when I go to their NPM pages:

https://www.npmjs.com/package/@firebase/app https://www.npmjs.com/package/@firebase/app-types

I see this:

This package is not intended for direct usage, and should only be used via the officially supported firebase package.

QUESTION:

Am I supposed to install them or not?

This is a known issue, and will be fixed in a future version of the JS SDK: https://github.com/firebase/firebase-js-sdk/pull/2082

It is safe to ignore the warnings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM