I installed the Firebase Functions and Firestore emulators in my project with firebase init > emulators
but now realize I don't need the Functions emulator any more so I'm trying to delete it.
How can I uninstall an emulator so that the firebase emulators:start
command doesn't try to start it by default?
I tried the following but firebase init > emulators
continues to show that the functions emulator is still enabled (green dot) and firebase emulators:start
continues to start the functions emulator by default if I don't include the --only firestore
flag.
firebase init > emulators
and deselected functions
firebase.json
"emulators": {
"functions": { // <-- I removed this block
"port": 5001
},
"firestore": {
"port": 8080
},
"ui": {
"enabled": true
}
}
~/.cache/firebase/emulators
functions
block from firebase.json
just to see if that was triggering it.
{
"functions": { // <-- I removed this block
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run clean",
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
],
"source": "functions"
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"emulators": {
"firestore": {
"port": 8080
},
"ui": {
"enabled": true
}
}
}
After doing all of the above, firebase emulators:start
still tries to start functions. I wondered if it might be because the firestore emulator depends on the functions emulator but if that were the case I don't know why it would let me run the firestore emulator alone with --only firestore
In my case, I deleted the Function directory from node_modules and I removed the functions block from firebase.json too.
I fixed it just running npm install firebase again.
If you don't want to use Cloud Functions in your project, you should remove the "functions" folder from your project directory as well.
Also, suggest that you file a bug for this on the firebase-tools GitHub. The fact that the functions emulator runs without configuration in firebase.json feels like a bug, and it didn't used to work that way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With