Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase serve error: Port 5000 is not open. Could not start functions emulator

I'm trying to serve firebase functions locally, but when I run firebase serve or firebase emulators:start the error message is: "Port 5000 is not open, could not start functions emulator."

I'm using Windows 10, so I've tried to change the port number, check if the port is blocked by Firewall and I create a new rule in Firewall to ports 5000-5010 but none of this approaches worked for me.

like image 896
Victor de Almeida Avatar asked Aug 17 '19 14:08

Victor de Almeida


People also ask

Is not open on localhost could not start firestore emulator?

This error is because of the failed quitting from firebase emulator. You already have the process of previous firebase emulator. For a new start, you have to find and stop the previous process.

How do I turn off firebase emulator?

Double tap CTRL-C (hold down CTRL and double tap C) in the terminal running the emulator when you want to shut down the emulator and clear all the ports and processes.

What is firebase emulator?

The Firebase Local Emulator Suite consists of individual service emulators built to accurately mimic the behavior of Firebase services. This means you can connect your app directly to these emulators to perform integration testing or QA without touching production data.


2 Answers

For Mac/Linux, use the Terminal/Shell to find the Process ID (PID), then kill the process.

sudo lsof -i :5000 sudo kill -9 PID 
like image 156
publicmat Avatar answered Oct 04 '22 00:10

publicmat


In MacOS Monterey, port 5000 may be claimed by a new "AirPlay Receiver". This can be disabled in Settings -> Sharing:

Screenshot of settings panel for disabling AirPlay Receiver

Disabling the AirPlay Receiver (if you do not need it) frees up port 5000.

like image 42
ErikWittern Avatar answered Oct 03 '22 22:10

ErikWittern