查看端口占用: lsof -i:端口号 清除占用该端口的所有进程: sudo kill -9 $(lsof -i:端口号 -t) 补充:windows环境下 netstat -ano |findstr "端口号"