How to kill a currently using port on localhost in windows?[TOP]
you can use port 5000, no 4000 in hexo, like this1
hexo s -p 5000
Step 1
Run command-line as an Administrator. Then run the below mention command. type your port number in yourPortNumber
netstat -ano | findstr :yourPortNumber
1 | C:\Users\yaokunyi>netstat -ano | findstr :35729 |
See the PID ? In here the port is 5396 (process identifier)
Step 2
Then you execute this command after identify the PID.
(/F forcefully terminates the process)
taskkill /PID typeyourPIDhere /F
1 | C:\Users\yaokunyi>taskkill /PID 5396 /F |
P.S. Run the first command again to check if process is still available or not. You’ll get empty line if process is successfully ended.
近期频繁使用gitbook,发现gitbook有时会出现端口被占用的问题无法启动服务,也是郁闷到底是谁占用的。