npm start 타임즈 오류 이벤트.js:186 throw er;//Unhandled 'error' event

3031 단어 ReactNative
맥 컴퓨터가 실행 중입니다pm start 타임즈 오류
ccl-mac:rn_yxq CC$ npm start

> [email protected] start /Users/CC/Desktop/RNTest/rn_yxq
> node node_modules/react-native/local-cli/cli.js start

┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│  Running Metro Bundler on port 8081.                                         │
│                                                                              │
│  Keep Metro running while developing on any JS projects. Feel free to        │
│  close this tab and run your own Metro instance if you prefer.               │
│                                                                              │
│  https://github.com/facebook/react-native                                    │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

events.js:186
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::8081
    at Server.setupListenHandle [as _listen2] (net.js:1298:14)
    at listenInCluster (net.js:1346:12)
    at Server.listen (net.js:1434:7)
    at /Users/CC/Desktop/RNTest/rn_yxq/node_modules/metro/src/index.js:253:20
    at new Promise ()
    at Object. (/Users/CC/Desktop/RNTest/rn_yxq/node_modules/metro/src/index.js:252:14)
    at Generator.next ()
    at asyncGeneratorStep (/Users/CC/Desktop/RNTest/rn_yxq/node_modules/metro/src/index.js:46:24)
    at _next (/Users/CC/Desktop/RNTest/rn_yxq/node_modules/metro/src/index.js:66:9)
Emitted 'error' event on WebSocketServer instance at:
    at Server.WebSocketServer._onServerError (/Users/CC/Desktop/RNTest/rn_yxq/node_modules/ws/lib/WebSocketServer.js:82:50)
    at Server.emit (events.js:214:15)
    at emitErrorNT (net.js:1325:8)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '::',
  port: 8081
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/CC/.npm/_logs/2019-09-12T03_14_54_656Z-debug.log

포트가 점용되었기 때문이다.포트 사용 명령을 확인합니다.오류 알림에 의하면, 내가 여기에서 검사한 것은 8081 포트인데, 각자의 상황이 다를 수 있다
lsof -i:8081
ccl-mac:rn_yxq CC$ lsof -i:8081
COMMAND  PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    6298   CC   24u  IPv6 0xf02143eb06cfe9f9      0t0  TCP *:sunproxyadmin (LISTEN)

현재 프로세스 죽이기
kill 6298
실행 중
npm start

좋은 웹페이지 즐겨찾기