When trying to do
var redis = require('socket.io/node_modules/redis');
I get the error "Cannot find module 'socket.io/node_modules/redis" and I can't figure out why. I am running windows and ran "npm install socket.io"
It seems like the same issue here: Error: Cannot find module 'socket.io/node_modules/redis' but the redis server is up and running.
In my "socket.io/node_modules" folder I don't see anything Redis related.
The socket.io package.json doesn't show a dependency on redis:
Either way, theres no need to directly depend on another library's dependencies. If you need to use
redis
in your code, you can install redis and add it to yourpackage.json
using:and require like:
Rather run
npm install socket.io-redis --save
This will install this npm package. I used this and it worked.
It seems that you're using Socket.IO 1.0. Since 1.0 there is no more
redis
dependency. You can follow @go-oleg's recommendation and installredis
package on your own.