I was unable to run functions shell without the emulators. It always error'd with
Error: Port 9001 is not open on localhost, could not start functions emulator.
I'm running a Mac with
"firebase": "^7.24.0",
"firebase-admin": "^9.9.0",
"firebase-functions": "^3.14.1",
and here's my firebase.json
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run build"
],
"source": "functions"
},
"emulators": {
"functions": {
"host": "localhost",
"port": "9001"
},
"firestore": {
"port": "9002",
"rules": "firestore.rules"
},
"pubsub": {
"port": "9004"
}
},
"hosting": {
"public":"public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"appAssociation": "AUTO",
"rewrites": [ {
"source": "/**",
"dynamicLinks": true
} ]
}
}
When running emulators and functions together I get a warning saying you might get unusual behaviour so it doesn't look like its the correct solution.
I tried this but it didn't work in my case but worth noting: Firebase serve error: Port 5000 is not open. Could not start functions emulator