2👍
✅
Running npm install socket.io
installs the latest version from npm which is now 1.1.0
. Your tutorial uses version 0.9
and a lot changed from that to 1.0
, including how to use the Redis adapter. Since the tutorial does not use a package.json to manage the dependencies you ended up with wrong version.
You can either upgrade your server code to work with latest socket.io
(for which you need to install socket.io-redis) or check the latest version from the 0.9
branch by running npm view socket.io versions
and then install npm install socket.io@0.9.17
.
And please remove the global installations, they will cause you gray hair later (npm uninstall -g socket.io
).
Source:stackexchange.com