node.js - Redis -nodejs simple program -ERROR -
i getting error simple nodejs redis commands. error getting.
/home/veera/radha/node_modules/redis-client/lib/redis-client.js:394 var callback = originalcommand[originalcommand.length - 1]; ^
typeerror: cannot read property 'length' of undefined @ client.onreply_ (/home/veera/radha/node_modules/redis-client/lib/redis-client.js:394:51) @ maybecallbackwithreply (/home/veera/radha/node_modules/redis-client/lib/redis-client.js:143:30) @ replyparser.feed (/home/veera/radha/node_modules/redis-client/lib/redis-client.js:183:29) @ socket. (/home/veera/radha/node_modules/redis-client/lib/redis-client.js:337:28) @ socket.emit (events.js:95:17) @ socket. (_stream_readable.js:765:14) @ socket.emit (events.js:92:17) @ emitreadable_ (_stream_readable.js:427:10) @ emitreadable (_stream_readable.js:423:5) @ readableaddchunk (_stream_readable.js:166:9)
and code is,
var client = require("./redis-node-client/lib/redis-client").createclient();
client.set('test', 'data');
my redis version ,
redis-server --version
redis server v=3.0.4 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=4e722bd58502cba0
https://github.com/fictorial/redis-node-client/issues/26 - same issue has been discussed long time version discussing 1.2. version 3.0.4. please me fix issue.
it looks library no more supported. ( description says abandoned project.) unless have strict requirement, use actively developed , production ready library node-redis.
example using node-redis
var client = require("node-redis").createclient(); client.set('test', 'data'); client.get('test',function(err, data){ if(err) console.log(err); else console.log('reply redis:' + data); }); client.quit();
Comments
Post a Comment