1

I am trying to understand how to get the version of firebase-admin that is required. My scenario is this:

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

Running npm update firebase-admin does not change anything.

package.json contains this line:

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

What am I supposed to do?

UPDATE: When doing firebase serve I get this error:

!  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)
Leo
  • 4,136
  • 6
  • 48
  • 72

1 Answers1

1

'npm update' is working, however the '^' carat against "firebase-admin" in your package.json will limit the updates to the 6.x releases - so it's not getting anything newer then the 6.5.1 release.

You can manually change the version of "firebase-admin" in your package.json to "^7.0.0" and then run 'npm install'. This will grab the latest release in the 7.x.x range.

M.Lewis
  • 961
  • 8
  • 18
  • 1
    Ah, thanks. I misread this at https://michaelsoolee.com/npm-package-tilde-caret/. I did not notice it said "latest minor or patch version". I thought it said "major" too. – Leo May 09 '19 at 22:42
  • But it still does not work. https://stackoverflow.com/questions/56068579/the-cloud-functions-emulator-requires-the-module-firebase-admin-to-be-installe – Leo May 09 '19 at 22:53