收到错误-在Windows机器上听EADDRINUSE ::: 3000 [英] getting an error- listen EADDRINUSE :::3000 on windows machine

查看:80
本文介绍了收到错误-在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.

这篇关于收到错误-在Windows机器上听EADDRINUSE ::: 3000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆