Nestjs8中使用nestjs-redis 提示can't resolve dependencies of the RedisCoreModule

发布于 2 年前 作者 phonegap100 2334 次浏览 最后一次编辑是 2 年前 来自 分享

Nestjs8中使用nestjs-redis 提示 Nest can’t resolve dependencies of the RedisCoreModule (Symbol(REDIS_MODULE_OPTIONS), ?). Please make sure that the argument ModuleRef at index [1] is available in the RedisCoreModule context

a.png

解决办法1:指定版本安装nestjs-redis(推荐)

以前安装依赖的方法:npm install nestjs-redis --save


指定版本安装nestjs-redis: cnpm install nestjs-redis@1.2.2 --save	


详情参考:https://github.com/skunight/nestjs-redis/issues/97		

解决办法2:通过 git 安装下面源对应的 redis

以前安装依赖的方法:npm install nestjs-redis --save


git地址安装依赖: cnpm i git+https://github.com/skunight/nestjs-redis.git --save	


详情参考:https://github.com/skunight/nestjs-redis/issues/93

如果Nestjs8 或者 Nestjs8.x 以后的版本没有遇到以上错误请忽略

回到顶部