포트 사용 에러

조회수 793회
yarn dev

실행 시 아래와 같이 에러가 발생합니다

[1] Error: listen EADDRINUSE: address already in use :::5000

그래서 터미널에서 sudo lsof -i : 5000을 사용하여 사용중인 포트의 PID 를 찾으려고 하였으나

이미지

사진과 같이 아무런 출력이 되지 않습니다.

어떻게 해야하나요?

전체 에러 코드는 아래와 같습니다.

Error: listen EADDRINUSE: address already in use :::5000
[1]     at Server.setupListenHandle [as _listen2] (node:net:1305:16)
[1]     at listenInCluster (node:net:1353:12)
[1]     at Server.listen (node:net:1440:7)
[1]     at Function.listen (/Users/eum_dong/workspace/react_workspace/react_app/node_modules/express/lib/application.js:618:24)
[1]     at Object.<anonymous> (/Users/eum_dong/workspace/react_workspace/react_app/server.js:13:5)
[1]     at Module._compile (node:internal/modules/cjs/loader:1095:14)
[1]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
[1]     at Module.load (node:internal/modules/cjs/loader:975:32)
[1]     at Function.Module._load (node:internal/modules/cjs/loader:816:12)
[1]     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
[1] Emitted 'error' event on Server instance at:
[1]     at emitErrorNT (node:net:1332:8)
[1]     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
[1]   code: 'EADDRINUSE',
[1]   errno: -48,
[1]   syscall: 'listen',
[1]   address: '::',
[1]   port: 5000
[1] }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[1] yarn client exited with code 1
--> Sending SIGTERM to other processes..
[0] yarn server exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  • (•́ ✖ •̀)
    알 수 없는 사용자
  • lsof 말고 sudo netstat -a|grep 5000 해보시겠어요? 엽토군 2021.7.15 17:57
  • sudo netstat -a|grep 5000 로 해봤는데 패스워드 입력 후 아무런 출력 없이 끝나요... 알 수 없는 사용자 2021.7.17 16:48

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)