I am creating a multi-node Express/Socket.io server using Typescript and I am trying to import RedisClient from redis, but I can’t get it to work because I get the error
Module ‘"redis"’ has no exported member ‘RedisClient’
It seems to be trying to retrieve it form
node_modules/redis/dist/index
But in reality it is here:
node_modules/@types/redis"
How can I get it to import from the right place?
2
Answers
After checking for some time I realized that things changed and the documentation states that you now do NOT need to use RedisClient. You now need to use:
This is what things look like now:
Looks like Redis package has been officially updated to v4 recently, which introduced some breaking changes, including several interface changes.
I recommend to temporarily use the v3 until all your dependencies (including @types/redis) are properly updated: