I use Node.js. My server js script I run such:
node chat_server.js
After I get errors messages in terminal CentOS:
Express server listening on port undefined in development mode.
+ User undefined connected node_redis: no callback to send error: ERR wrong number of arguments for 'sadd' command
/home/who/public_html/node/node_modules/redis/index.js:582 throw err; ^ Error: ERR wrong number of arguments for 'sadd' command at ReplyParser. (/home/who/public_html/node/node_modules/redis/index.js:317:31) at ReplyParser.emit (events.js:95:17) at ReplyParser.send_error (/home/who/public_html/node/node_modules/redis/lib/parser/javascript.js:296:10) at ReplyParser.execute (/home/who/public_html/node/node_modules/redis/lib/parser/javascript.js:181:22) at RedisClient.on_data (/home/who/public_html/node/node_modules/redis/index.js:547:27) at Socket. (/home/who/public_html/node/node_modules/redis/index.js:102:14) at Socket.emit (events.js:95:17) at Socket. (_stream_readable.js:748:14) at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:410:10)
Excuse me, but I do not understand the reason of these errors. On what I should get attention and how fix it?
For example, I use command redis SADD: redis_cli.sadd( "user.friend:" + currentIdUser, data.idUser);
I have done a experiment, created a new text script:
var redis = require("redis");
var client = redis.createClient();
client.on("error", function (err) {
console.log("Error " + err);
});
client.sadd("users","naveen",function(err,reply){
console.log('Ok');
if(err)
throw err;
return reply;
});
It have given me in console: OK. It mean, that all works fine. I think in my code:
redis_cli.sadd("userslist", currentIdUser);
the variable currentUser is simply empty or undefined. It gives me the next errors.
default_port = 6379, default_host = "127.0.0.1";
– Aliceredis
andnode
version? – Ravi