본문 바로가기

ETC.

Build Error ::: npm start 시 포트번호가 이미 사용중이라고 나온다면?

error listen EADDRINUSE: address already in use :::8081.
Error: listen EADDRINUSE: address already in use :::8081
    at Server.setupListenHandle [as _listen2] (node:net:1331:16)
    at listenInCluster (node:net:1379:12)
    at Server.listen (node:net:1467:7)
    at /Users/.../node_modules/metro/src/index.js:164:16
    at new Promise (<anonymous>)
    at Object.exports.runServer (/Users/.../node_modules/metro/src/index.js:163:10)
    at async Object.runServer [as func] (/Users/.../node_modules/@react-native-community/cli-plugin-metro/build/commands/start/runServer.js:121:26)
    at async Command.handleAction (/Users/.../node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.

위 오류처럼 8081 포트가 사용중이라고 나온다면 8081 포트를 사용중인걸 종료시켜버리면 된다.

 

 

sudo lsof -i :8081
비밀번호 입력
kill -9 [PID 번호]