Organizational Research By

Surprising Reserch Topic

require socket io client js not working


require socket io client js not working  using -'node.js,socket.io'

I was able to get the basic socket.io server application running on my own server, and request it directly through any web browser (I tried FF, chrome, and IE7 which all worked).

Now, the issue comes in that the client sample code doesn't work for me, and I get the following error in the javascript console in chrome:


  "Uncaught ReferenceError: require is not defined" in reference to this line of code in socket.io.js:
  var client = require('socket.io-client');


This leads me to believe that it doesn't recognize the require command period, which seems odd.  A couple of other things - I have apache running, and so moved all of my socket.io files into my apache directory htdocs to be accessed through http port 80 which were installed using cygwin and the guide at: https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)

The socket.io files were also installed under the cygwin directory on my c: drive in windows, where they are not useful if accessed by apache.  One other tidbit - I do have a socket.io-client.js file, but when I opened it to edit using wordpad, it looks corrupted, having only one line of text inside: <symlink>ÿþi
    

asked Sep 18, 2015 by rajeevr642
0 votes
2 views



Related Hot Questions

1 Answer

0 votes
NULL
answered Sep 18, 2015 by rolvyrf

...