I'm having a hard time adding Socket.IO as a submodule and using
require.
git submodule add
https://github.com/LearnBoost/Socket.IO.git vendor/
Socket.IO --recursive *
git submodule update --init --recursive
*Note that on the README page of Socket.IO "git clone" was used
instead of "git submodule add". Cloning it was not adding it as a
submodule for me. The --recursive option on "git submodule add" didn't
fetch the submodules but the "git submodule update --init --recursive"
does.
Then I want to require it in my server:
var io = require('./vendor/Socket.IO/
socket.io');
ReferenceError: io is not defined
at /Users/prat/src/chess/ChessGlue/website/
chessglue.com/vendor/
Socket.IO/socket.io.js:39:2
at Object.<anonymous> (/Users/prat/src/chess/ChessGlue/website/
chessglue.com/vendor/Socket.IO/socket.io.js:86:2)
at Module._compile (node.js:462:23)
at Module._loadScriptSync (node.js:469:10)
at Module.loadSync (node.js:338:12)
at loadModule (node.js:283:14)
at require (node.js:411:14)
at Object.<anonymous> (/Users/prat/src/chess/ChessGlue/website/
chessglue.com/app.js:14:10)
at Module._compile (node.js:462:23)
at Module._loadScriptSync (node.js:469:10)
What would the require line be?