Socket.io fails to emit messages to Node server on Chrome & Firefox Socket.io fails to emit messages to Node server on Chrome & Firefox google-chrome google-chrome

Socket.io fails to emit messages to Node server on Chrome & Firefox


I believe you're using the wrong socket.io.js file for the client?

https://github.com/LearnBoost/socket.io-client/tree/master/dist

you should use these files in a folder where you have your client-side stuff on, ie: ../js/socket.io.min.js

About the require problem, are you using npm? go into the nodeJS project folder and run the following:

npm install socket.io

this should install to the node_modules folder inside your project folder and by doing a require('socket.io'); you should be able to access the module.

if this isn't working, you probably have a corrupt installation of node.

PS: Are you using the same port for the files? you seem to be looking for the socket.io file on port 8080 and then connecting to nodeJS on port 8080 for socket connections...

try using another port?