Firebase Cloud Function Emulator Not Starting I've been trying to test my cloud functions locally using the cloud function emulator but it doesnt seem to work. What happens it when i run:
firebase emulators:start

I get the following:
i  emulators: Starting emulators: functions
+  hub: emulator hub started at http://localhost:4400
i  emulators: Shutting down emulators.
i  hub: Stopping emulator hub

Error: An unexpected error has occurred.

Having trouble? Try again or contact support with contents of firebase-debug.log

This is how my firebase.json looks like:
{
  "functions": {
    "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]
  },
  "emulators": {}
}

I've tried running, firebase init several times, and also firebase init emulators but none of them have worked so far.
The account am signed in with has Editor permission on it.
Please help I seriously need this.

I saw this too, but creating a build fixed the issue for me, e.g npm run build or yarn build
This recreates node_modules and possibly updates your lock file to sync dependencies


I've tried running, firebase init several times, and also firebase init emulators but none of them have worked so far.

See https://firebase.google.com/docs/emulator-suite/install_and_configure .
You will need CLI version 7.8.0 or higher to use the Emulator Sute.

At first, could you check your node version and firebase version?
The following log is command history log at my local machine.
$ node -v
v10.20.1
$ firebase -V
8.2.0
$ firebase emulators:start
i  emulators: Starting emulators: firestore
i  firestore: downloading cloud-firestore-emulator-v1.11.3.jar...
Progress: > (100% of 64MB
i  firestore: Removing outdated emulator files: cloud-firestore-emulator-v1.10.2.jar
i  firestore: firestore emulator logging to firestore-debug.log
✔  firestore: firestore emulator started at http://localhost:8080
i  firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
✔  emulators: All emulators started, it is now safe to connect.


.firebaserc

{}


firebase.json

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "emulators": {
    "firestore": {
      "port": 8080
    }
  }
}