我正在尝试在模拟器上运行React Native项目(奇怪的是,如果我在连接的(物理)设备上运行,它似乎运行正常。当我运行react-native run-ios时,出现以下错误:
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8081
at Server.setupListenHandle [as _listen2] (net.js:1286:14)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at /Applications/MAMP/htdocs/tradesmartv4/node_modules/metro/src/index.js:193:18
at new Promise (<anonymous>)
at Object.<anonymous> (/Applications/MAMP/htdocs/tradesmartv4/node_modules/metro/src/index.js:192:12)
at Generator.next (<anonymous>)
at step (/Applications/MAMP/htdocs/tradesmartv4/node_modules/metro/src/index.js:50:30)
at /Applications/MAMP/htdocs/tradesmartv4/node_modules/metro/src/index.js:61:15
Emitted 'error' event at:
at Server.WebSocketServer._onServerError (/Applications/MAMP/htdocs/tradesmartv4/node_modules/ws/lib/WebSocketServer.js:82:50)
at Server.emit (events.js:187:15)
at emitErrorNT (net.js:1313:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
Process terminated. Press <enter> to close the window
我尝试了所有可以找到的修复程序(例如“ killall”等),但都无济于事。感谢任何人都能提供的帮助。
干杯!
我尝试了各种KillAll建议,删除了npm文件夹,删除了ios build文件夹