0

I have a WEB app written in React and whenever I try to run it with react-app-rewired start it complains that Something is already running on port XYZ.

I've checked if any process is listening on port XYZ with netstat -a -b, but there was none. Also, if I change port XYZ to any 4 digit value (with environment variable PORT=3001), I'll always get the same problem, that the port is already taken, so I'm concluding that port is not taken but something is going on down under. I'm running on Windows 10 with Node 12 Installed (I tried downgrading to node 10 because I think this used to work for me on lower node version, but I couldn't get it working anymore).

I've searched the web and most of them suggest checking if port is taken, few other I found are bellow but didn't work for me:

Did anyone had similar problems and was able to resolve them?

Tadej
  • 379
  • 4
  • 12

2 Answers2

2

It turns out it was Hyper-V taking all the ports....After disabling Hyper-V I was able to run node app on port 3000.

Workaround for this issue is to reserve ports while Hyper-V is turned off:

  1. Disable hyper-v (which will required a couple of restarts)

dism.exe /Online /Disable-Feature:Microsoft-Hyper-V

  1. When you finish all the required restarts, reserve the port you want so hyper-v doesn't reserve it back

netsh int ipv4 add excludedportrange protocol=tcp startport=3000 numberofports=1

  1. Re-Enable hyper-V (which will require a couple of restart)

dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

References:

Tadej
  • 379
  • 4
  • 12
-1

Try:

taskkill /im node.exe

And if the processes still persist, you can force the processes to terminate by adding the /f flag:

taskkill /f /im node.exe
jdoroy
  • 898
  • 1
  • 7
  • 10
  • I've tried that now: ```$ taskkill /f /im node.exe ERROR: The process "node.exe" not found. ``` When starting the WEB APP I still get `Something is already running on port 3000.` – Tadej Feb 08 '20 at 07:11