RCTWebRTCDemo icon indicating copy to clipboard operation
RCTWebRTCDemo copied to clipboard

android red screen with error: requiring unknown module "socket.io-client/socket.io"

Open kosmosby opened this issue 8 years ago • 3 comments

hi.

just follow install instruction for android and have red screen with this error:

android red screen with error: requiring unknown module "socket.io-client/socket.io"

npm --version 4.0.5 node --version v7.4.0 which node /usr/local/bin/node which npm /usr/local/bin/npm

could you help to install it please? thanks.

kosmosby avatar Jan 23 '17 14:01 kosmosby

@kosmosby I ran into the same error screen but on ios.

Here are the changes I made locally to proceed. YMMV!

(master *+)$ git diff main.js package.json
diff --git a/main.js b/main.js
index cf6b821..23cfdfc 100644
--- a/main.js
+++ b/main.js
@@ -11,7 +11,7 @@ import {
   ListView,
 } from 'react-native';

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

 const socket = io.connect('https://react-native-webrtc.herokuapp.com', {transports: ['websocket']});

@@ -25,7 +25,7 @@ import {
   getUserMedia,
 } from 'react-native-webrtc';

-const configuration = {"iceServers": [{"url": "stun:stun.l.google.com:19302"}]};
+const configuration = {"iceServers": [{"url": "stun:stun.l.google.com:19305"}]};

 const pcPeers = {};
 let localStream;
diff --git a/package.json b/package.json
index 759b29e..b6c454e 100644
--- a/package.json
+++ b/package.json
@@ -6,9 +6,9 @@
     "start": "node node_modules/react-native/local-cli/cli.js start"
   },
   "dependencies": {
-    "react": "15.2.0",
-    "react-native": "^0.29.0",
+    "react": "15.4.0-rc.4",
+    "react-native": "^0.40.0",
     "react-native-webrtc": "git+https://[email protected]/oney/react-native-webrtc.git",
-    "socket.io-client": "^1.3.7"
+    "socket.io-client": "^1.7.2"
   }
 }

d6y avatar Jan 24 '17 17:01 d6y

Using this version works for me.

  "dependencies": {
    "react": "15.2.0",
    "react-native": "0.29.0",
    "react-native-webrtc": "0.13.0",
    "socket.io-client": "1.3.7"
  }

gusgard avatar Jan 24 '17 21:01 gusgard

thanks guys, I will arrange a new version in the following weeks

zxcpoiu avatar Jan 26 '17 11:01 zxcpoiu