node-redis:ErrorReply: ERR wrong number of arguments for ‘auth‘ command
问题描述
环境
$ node -v
v16.14.0# redis-cli
127.0.0.1:6379> info
# Server
redis_version:5.0.5
版本 package.json
{"dependencies": {"redis": "^4.2.0"}
}
代码
import { createClient } from 'redis'const REDIS_URL = "redis://root:123456@127.0.0.1:6379"export async function getRedisClient() {// 连接redisconst client = createClient({url: REDIS_URL,})await client.connect()return client
}
报错
node:internal/process/promises:265triggerUncaughtException(err, true /* fromPromise */);^[ErrorReply: ERR wrong number of arguments for 'auth' command]
解决办法
明明是按照格式写的,却报错了
redis[s]://[[username][:password]@][host][:port][/db-number]
按照github上的issues,如果是默认username, 那么需要省略
const REDIS_URL = "redis://:123456@127.0.0.1:6379"
参考
https://github.com/redis/node-redis/issues/1591
node-redis:ErrorReply: ERR wrong number of arguments for ‘auth‘ command相关推荐
- ERR wrong number of arguments for 'sadd' command
在用spring redis 存储set数据的时候,提示了这个ERR wrong number of arguments for 'sadd' command这个错误,通过调试发现: redisTem ...
- ERR wrong number of arguments for ‘srem‘ command
ERR wrong number of arguments for 'srem' command 问题描述 再远程调用redis服务得时候,出现得这个异常,字面意思就是参数不匹配 问题解决 原因是因为 ...
- (error) ERR wrong number of arguments for 'hmget' command
首先不存在hmgetall这样的命令, localhost:6379> hgetall people_info "\xe5\xbc\xa0\xe5\xb0\x8f\xe4\xba\x8 ...
- org.springframework.dao.InvalidDataAccessApiUsageException: ERR wrong number of arguments for ‘srem‘
1.报错信息 org.springframework.dao.InvalidDataAccessApiUsageException: ERR wrong number of arguments for ...
- C++工作笔记-hiredis中关于ERR wrong number of arguments for HMSET问题的解决
这里有个坑 使用hiredis的API进行调用时如果是如下命令, hmset userid:1001 username 'xiao ming' 这种语法,使用redis-cli是没有问题的,但如果使用 ...
- Redis问题:ERR max number of clients reached
redis高并发下,可能有些连接没有释放,导致连接数耗尽,会提示 ERR max number of clients reached 这个时候通过命令查看客户端使用连接数 [root@home-ser ...
- node安装:npm install xxx命令出现npm ERR code EPERM错误
下载安装node和npm,执行node -v和npm -v成功, node下载:下载 | Node.js 中文网 安装教程:node.js 安装详细步骤教程_老油条-CSDN博客_node安装 但执行 ...
- Node.js:它是什么,何时以及如何使用它,以及为什么要使用它
by Pablo Regen 通过帕勃罗·雷根(Pablo Regen) You've probably read these sentences before- 您可能已经读过这些句子了-- Nod ...
- node redis集群_如何使用集群扩展Node.js服务器
node redis集群 by Michele Riva 由Michele Riva 如何使用集群扩展Node.js服务器 (How to scale your Node.js server usin ...
最新文章
- 既然他人的成功与自己无关,何必过于关注他人?
- 24BYJ48电机的使用,带驱动程序
- MySQL备份恢复工具xtrabackup
- Android解决依赖冲突
- python——成语接龙小游戏
- IOS 应用中从竖屏模式强制转换为横屏模式
- Spring通知类型及使用ProxyFactoryBean创建AOP代理
- b站电脑客户端_B站(哔哩哔哩) 视频批量下载工具#电脑版##更新
- Java 程序 ——感想
- android 融云sdk集成,使用融云SDK集成
- 动态更新 HTML 内容 —— AJAX
- 夸奖对方代码写的好_我写出这样干净的代码,老板直夸我
- sqlmap DVWA脱库
- 公安部督办侵犯个人信息案:银行行长卖账号
- ps cc 2014 智能切图
- python文件或目录损坏且无法读取,data\sogoupy\verify.ini已损坏且无法读取,啥意思?谢谢?...
- 光纤跳线结构及分类介绍
- 关于淘客软件的那些事儿
- 电脑不显示无线连接网络连接服务器,连接wifi后显示无internet访问权限怎么解决...
- 外观模式——透过现象看本质