node.js - Socket.io-redis 作为适配器添加到 Socket.io 实例时会出错
问题描述
我正在尝试使用 Socket.io 和 Socket.Io-redis。我已经启动并运行了我的 Redis 服务器。我在启动 Socket.Io 服务器时遇到的错误是:ReplyError: ERR unknown command 'pubsub' 我不知道为什么我会收到这个错误。
我使用的 Redis 版本是 2.4.5
io.adapter(redisIO({host: 'localhost', port: 6379}));
io.of('/').adapter.clients((err, clients) => {
if(err){
console.log('error!!')
throw err;
}
解决方案
我通过安装最新版本的 Redis 来修复它!:)
推荐阅读
- javascript - Powershell中的Javascripts encodeURI等价物?
- git - 无法克隆 Git Repo:SSL 替代证书错误
- html - 中间“数据标签”中的新行
- java - 无法从 firebase 获取结果并显示在警报对话框中
- python - 如何在python中将文本文件拆分为适当数量的列?
- android - Android:ClickableSpan 与 EditText 中行尾的文本不匹配。我怎样才能解决这个问题?
- angular - ngrx 8 选择器的效果
- excel - 如何循环遍历一个范围加一个整数?
- php - 编辑 Wordpress Footer.php 时出现错误消息
- reporting-services - SSRS HTTP 错误 503(Web 门户可访问,但报告不可访问)