Node.js and Socket.IO have a compatibility error (as of 2010-10-22).
Node.js 0.3-pre has changed the word 'sys' to 'util' in many places.
Node.js 0.2:
var sys = require('sys');
Node.js 0.3:
var util = require('util');
Socket.IO-node hasn't caught up yet, which causes errors like this:
The 'sys' module is now called 'util'.
This page is to document the error and show how to fix it.
Get Node.js
git clone git://github.com/ry/node.git cd node ./configure sudo make sudo make install
Get Socket.IO
git clone git://github.com/LearnBoost/Socket.IO-node.git --recursive cd Socket.IO-node sudo make
The error message from make is:
./support/expresso/bin/expresso -I lib tests/*.js The 'sys' module is now called 'util'. It should have a similar interface.
We want to change the files this way:
To find the relevant files and change them:
cd Socket.IO-node find . -name '.git' -prune -o -regex '.*\.\(c\|cpp\|h\|hccp\)$' -prune -o -print \ | xargs grep "'sys'" -l \ | xargs sed -i "s/\bsys\b/util/g"