简体   繁体   中英

The Cloud Functions emulator requires the module “firebase-admin” to be version >7.0.0 so your version is too old

The Cloud Functions emulator requires the module "firebase-admin" to be version >7.0.0 so your version is too old. You can probably fix this by running "npm install firebase-admin@latest" in your functions directory.

We are currently using these versions:

"firebase-admin": "~6.0.0"
"firebase-functions": "^2.0.3"
"firebase-functions-test": "^0.1.3"
"firebase-tools": "^6.8.0"
"node": "8"

We have tried deleting and reinstalling all node modules and we have also deleted any global installations of Firebase-related node modules

Needless to say, we have also tried running npm install firebase-admin@latest in our functions' directory.

The error seemingly started appearing out of the blue. That is, we have not made any changes to our package.json file between when the functions were working and when they started to give us this error.

The answer to The Cloud Functions emulator requires the module "firebase-admin" to be installed suggests downgrading firebase-tools to version 6.8.0 , which appears to be our current version.

The fix for us was to remove the ^ from the firebase-tools version.

"firebase-tools": "^6.8.0" // before
"firebase-tools": "6.8.0"  // after

The minor version upgrade from 6.8.0 to 6.10.0 introduced the breaking change.

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