node_modules/metro/src/lib/attachWebsocketServer.js code example

Example: node_modules/metro/src/lib/attachWebsocketServer.js

I tried following steps it resolves my issue

Running packager on different port react-native start --port 8084 --reset-cache
Run react-native run-android --port 8084 in second Command Prompt window.
After error screen appear clicking Ctrl + M.
Click Dev Settings button at the bottom.
Click Debug server host & port for device button.
Type localhost:8084 and click OK button.
Again run react-native run-android --port 8084

Tags:

Misc Example