How to restart server in React / Node

If you changed something and chnages not reflecting and you want to start server

but if its shows that port is already running then you have first close this port and then try to start it.

How to Close/Stop PORT

1. Terminate the existing process using port 5000:

If you have a server already running on port 5000 (and you want to restart it), you need to stop that process first.

For Windows:

  1. Open Command Prompt or PowerShell as Administrator.
  2. Find the process using port 5000:

    • This will show you the Process ID (PID) of the application using port 5000. E.X
      TCP 0.0.0.0:5000 0.0.0.0:0 LISTENING 4980
      TCP [::]:5000 [::]:0 LISTENING 4980
    • Kill the process using the PID found above. For example, if the PID is 4980, use:

      This command forcefully stops the process occupying port 5000.

Leave a Reply

Your email address will not be published. Required fields are marked *