If you’re getting port-related errors, the first thing to do is to kill the process running on that specific port. You can do it with Terminal in three steps:
Run the command lsof -i :   (make sure to insert your port number) to find out what is running on this port
Copy the Process ID (PID) from the Terminal output
Run the command kill -9 (make sure to insert your PID) to kill the process on port.