-
Node / Express: EADDRINUSE, Address already in use - Kill serverPrograming Study/E.T.C 2022. 1. 26. 14:33728x90반응형
사건의 발단
have a simple server running in node.js using connect:
var server = require('connect').createServer(); //actions... server.listen(3000);
In my code I have actual handlers, but thats the basic idea. The problem I keep getting is
EADDRINUSE, Address already in use
I receive this error when running my application again after it previously crashed or errors. Since I am not opening a new instance of terminal I close out the process with ctr + z.
I am fairly certain all I have to do is close out the server or connection. I tried calling server.close() in process.on('exit', ...); with no luck.
해결책
You can also go the command line route:
ps aux | grep node
to get the process ids.
Then:
kill -9 PID
Doing the -9 on kill sends a SIGKILL (instead of a SIGTERM). SIGTERM has been ignored by node for me sometimes
도움되셨다면 하단의 광고 클릭 부탁드립니다 :)
728x90반응형'Programing Study > E.T.C' 카테고리의 다른 글
E.T.C) HTTP 상태코드 (0) 2022.02.18 Git) ignore 안될때 (node_modules 제거) (0) 2022.01.27 Mysql) Timestemp(데이터타입) 조회할때 날짜 비교하기 (0) 2022.01.18 Amazon) express(node.js) 이용해서 s3에 이미지 업로드하기 (0) 2022.01.10 NPM과 YARM의 차이점 (0) 2022.01.05