Question

I'm new to redis, and I'm trying out various examples. However, it doesn't seem to work:

root@localhost:~# node lol.js
Reply: OK
Error: Error: Error: ERR unknown command 'hset'
Error: Error: Error: ERR unknown command 'hset'

/root/node_modules/redis/index.js:468
                throw callback_err;
                      ^
TypeError: Cannot read property 'length' of undefined
    at Command.callback (/root/lol.js:15:28)
    at RedisClient.return_error (/root/node_modules/redis/index.js:464:25)
    at HiredisReplyParser.<anonymous> (/root/node_modules/redis/index.js:253:14)
    at HiredisReplyParser.emit (events.js:67:17)
    at HiredisReplyParser.execute (/root/node_modules/redis/lib/parser/hiredis.js:41:18)
    at RedisClient.on_data (/root/node_modules/redis/index.js:440:27)
    at Socket.<anonymous> (/root/node_modules/redis/index.js:70:14)
    at Socket.emit (events.js:67:17)
    at TCP.onread (net.js:367:14)

I'm using one of the example scripts on the github page for node-redis. I'm on Debian Squeeze.

Était-ce utile?

La solution

The main problem is not with your code (of course it could recognize the error sent by the server) or with the node redis module but with the Redis server.

You need to upgrade it to a newer version, HSET command is supported since version 2.0.0.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top