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

Victor de Almeida picture Victor de Almeida · Aug 17, 2019 · Viewed 12.5k times · Source

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.

Answer

publicmat picture publicmat · May 5, 2020

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