Redis duplicate method missing when initializing node-celery client

I’m working with node-celery version 0.2.8 and trying to use Redis as my backend. Every time I try to run celery.createClient(), I keep getting this error message:

self.redis.duplicate is not a function

I did some digging and found that around line 137 in the celery.js file, it calls redis.createClient() first, then tries to use the duplicate() method on what gets returned. The problem is that this returned object doesn’t have any duplicate property available.

The weird part is that I don’t even have the redis module installed locally, and it’s not listed in node-celery’s dependencies either. You’d think this would fail much earlier in the process, but somehow it gets to this point before breaking.

I’ve checked the node-celery repository for similar issues but haven’t found anything helpful. Has anyone else run into this problem before? Any ideas on what might be causing this?

had this exact problem b4. node-celery needs an old redis client but it doesn’t bundle it right lol. install redis@2.8.0 specifically - newer versions drop the duplicate method that breaks everything. also, check ur celery config to make sure it points to the right redis instance.

This issue arises from the fact that node-celery requires a specific version of the Redis client that includes the duplicate() method. Since Redis is not installed locally, it’s likely that node-celery is falling back on an embedded Redis client that lacks this method. I faced a similar problem with earlier versions of node-celery. To resolve this, you should explicitly install a compatible Redis package, such as redis@^2.8.0, which contains the necessary duplicate method. Additionally, consider looking for a newer fork or alternative, as node-celery 0.2.8 is quite outdated and may have compatibility issues with newer Node.js versions.

Oh interesting! What Node version are you running? Might be a compatibility issue. Have you checked what the Redis client object looks like when it fails? Try console.logging it right before the duplicate call to see what’s missing.