oney / RCTWebRTCDemo

MIT License
215 stars 141 forks source link

Run-time simulator Error: Unable to resolve module `socket.io-client/socket.io` from `[code directory]/RCTWebRTCDemo/main.js`: #49

Open cppiod opened 7 years ago

cppiod commented 7 years ago

Unable to resolve module socket.io-client/socket.io from /Users/cpp/devworkspace/ReactNative/RCTWebRTCDemo/main.js: Module does not exist in the module map or in these directories: /Users/cpp/devworkspace/ReactNative/RCTWebRTCDemo/node_modules/socket.io-client , /Users/cpp/devworkspace/node_modules/socket.io-client , /Users/cpp/node_modules/socket.io-client

This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following:

  1. Clear watchman watches: watchman watch-del-all.
  2. Delete the node_modules folder: rm -rf node_modules && npm install.
  3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start --reset-cache.
kim-jikyung commented 7 years ago

In /Users/cpp/devworkspace/ReactNative/RCTWebRTCDemo/main.js:

before import io from 'socket.io-client/socket.io';

after import io from 'socket.io-client/dist/socket.io';