Error:

Error: Could not start Firestore Emulator, port taken.

i emulators: Starting emulators: auth, functions, firestore, database, hosting, pubsub ⚠ hosting: The hosting emulator is configured but there is no hosting configuration. Have you run firebase init hosting? ⚠ firestore: Port 8080 is not open on localhost (127.0.0.1,::1), could not start Firestore Emulator. ⚠ firestore: To select a different host/port, specify that host/port in a firebase.json config file: { // ... "emulators": { "firestore": { "host": "HOST", "port": "PORT" } } } ⚠ database: Port 9000 is not open on localhost (127.0.0.1,::1), could not start Database Emulator. ⚠ database: To select a different host/port, specify that host/port in a firebase.json config file: { // ... "emulators": { "database": { "host": "HOST", "port": "PORT" } } }

A quick way to fix this is to use the kill-port package from NPM (https://www.npmjs.com/package/kill-port)

  1. Open up your project
  2. cd functions
  3. npm i --save kill-port
  4. Run the npx command

npx kill-port --port 8000,9099,5001,8080,9000,5000,8085,9199,4000,4400,4500 && firebase emulators:start --project default

You're good to go 🙌🏾

More Stories, Tips and tricks
Solving the Gradle Error: 'Failed to calculate the value of task' in Flutter
Stuck with a persistent Gradle error in your Flutter project? Discover a quick fix for the 'Failed to calculate the value of task' error and get your project back on track.
Read more
Google Play Developer: Target SDK API Level 33 Deadline
Unlock Success: Google Play Developer Deadline Secrets Revealed! Don't miss out on crucial insights
Read more
Telegram: Get a channel Id from Telegram
Working with a Telegram bot is awesome. Here are some pointers.
Read more