How to stop the node.js inspector / Chrome Debugger on SIGINT?

时间秒杀一切 提交于 2019-12-02 19:41:17
KhogaEslam

It seems that VSCode, Puppeteer, nodemon, express, etc. causes this problem, you ran a process in the background or just closed the debugging area [browser, terminal, etc. ] or whatever , anyway, you can in CMD run

$ ps ax | grep node

then

$ killall -9 node

it is not the best solution, also, i may suggest that you look for the process using this port then send close signal

$ sudo ss -lptn 'sport = :9229'

OR

$ sudo netstat -nlp | grep :9229

OR

$ sudo lsof -n -i :9229 | grep LISTEN

THEN:

$ sudo kill <pid>

OR JUST [the two steps in one]

$ sudo kill `sudo lsof -t -i:9229`

OR

$ sudo kill $(sudo lsof -t -i:9229)

I had the same terminal error from nodemon, even though I thought I'd quit all terminal processes, but simply quitting VSCode and reopening solved for me (thanks to KhogaEslam's answer for the hint).

Hope this helps someone else too!

was at a node docker. with ss, complete, if u know the port is open:

kill `ss -lptn 'sport = :THE_PORT' | tail -n1 | cut -d, -f2 | cut -d= -f2`
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!