node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

Cannot read property 'length' of undefined

Open maly opened this issue 14 years ago • 2 comments

redis module 0.8.1 redis-server 2.4.15 node version 0.8.8

code: var redis = require("redis-client").createClient(); redis.rpush("foo", "bar");

error:

/root/node_modules/redis-client/lib/redis-client.js:394 var callback = originalCommand[originalCommand.length - 1]; ^ TypeError: Cannot read property 'length' of undefined at Client.onReply_ (/root/node_modules/redis-client/lib/redis-client.js:394:51) at ReplyParser.feed.maybeCallbackWithReply (/root/node_modules/redis-client/lib/redis-client.js:143:30) at ReplyParser.feed (/root/node_modules/redis-client/lib/redis-client.js:169:21) at Socket. (/root/node_modules/redis-client/lib/redis-client.js:337:28) at Socket.EventEmitter.emit (events.js:88:17) at TCP.onread (net.js:395:14)

maly avatar Sep 20 '12 11:09 maly

It seems you used another redis module, redis-client is different from redis. Try npm install redis instead of npm install redis-client.

skenqbx avatar Sep 20 '12 11:09 skenqbx

Thanks skenqbx! I am an idiot, sorry... My fault.

maly avatar Sep 20 '12 12:09 maly