Can't open port even there is no other applications are listening on it [Windows]

The reason is that Hyper-V takes over these ports, to prevent it from happening do the following:

  1. dism.exe /Online /Disable-Feature:Microsoft-Hyper-V (then restart)
  2. netsh int ipv4 add excludedportrange protocol=tcp startport=<your port, mycase: 8888> numberofports=1
  3. dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All (then restart)

The original solution is here.

If after that you still can't bind to the port do the following:

  • netsh http add iplisten 0.0.0.0 for IPv4
  • netsh http add iplisten :: for IPv6

More information is here.