打开命令行窗口

输入 netstat -ano |findstr (需要关闭的端口)

比如要关闭8081这个端口

输入 taskkill /t /f /im (根据端口得到的进程号)

例如:

 21500就是上面查到的进程号