收到错误

编程入门 行业动态 更新时间:2024-10-28 02:32:59
本文介绍了收到错误-在Windows机器上听EADDRINUSE ::: 3000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经进行了大量搜索,并且我了解在端口3000上运行着某些进程或服务器,但是如何停止它并在端口3000上运行新的express http服务器.对于Unix环境,很少有答案可以告诉它..但是如何使用cmd终端在Windows环境中释放端口. 使用PID关闭任务对我也不起作用. 预先感谢

I've searched a lot and I understand there is some process or server running on port 3000, but how can I stop that and run a new express http server on port 3000. There are few answers which tell it for Unix environment..but how to release the port on windows environment using cmd terminal. Closing the task using PID also didn't work for me. Thanks in advance

推荐答案

打开命令提示符并键入以下内容

Open the command prompt and type the following

netstat -a -o -n

按端口排列该列表,直到找到端口3000,然后您将看到进程ID.然后运行

run down the list by port until you find port 3000 and you will see the process id. Then run

taskkill /F /PID (yourprocessID)

还有另一种简单的方法可以在单个命令中完成

there's another simple way to do this in a single command

FOR /F "tokens=4 delims= " %%P IN ('netstat -a -n -o ^| findstr :3000') DO TaskKill.exe /PID %%P

如果您使用Windows 7 U,则可能需要tokens=5,请谨慎使用令牌,以用于不同的操作系统.

if you use windows 7 U might need tokens=5, use with caution tokens are different for different OS.

更多推荐

收到错误

本文发布于:2023-08-07 14:02:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1319461.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!