错误:连接 ECONNREFUSED 127.0.0.1:6379

错误:连接 ECONNREFUSED 127.0.0.1:6379

嗨,我在 m1 上开发一个 typescript 项目(express、PostgreSQL),我将 Redis 安装在 yarn 上并启动了本地服务器(nodemon),然后发生了错误。在我将 Redis 实现到我的项目之前,这不是问题。

这是错误

> % yarn dev2 
yarn run v1.22.10
$ nodemon --exec ts-node src/index.ts
[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts,json
[nodemon] starting `ts-node src/index.ts`
[discovery] ORM entity discovery started, using ReflectMetadataProvider
[discovery] - processing entity Post
[discovery] - processing entity User
[discovery] - entity discovery finished, found 2 entities, took 13 ms
[info] MikroORM successfully connected to database postgres on postgresql://[email protected]:5432
[query] select table_name, nullif(table_schema, 'public') as schema_name from information_schema.tables where table_schema not like 'pg_%' and table_schema != 'information_schema' and table_name != 'geometry_columns' and table_name != 'spatial_ref_sys' and table_type != 'VIEW' order by table_name [took 18 ms]
[query] begin
[query] select * from "mikro_orm_migrations" order by "id" asc [took 3 ms]
[query] commit
server started on localhost:4000
Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
[nodemon] app crashed - waiting for file changes before starting...

我想知道

  • 在这种情况下如何在 Redis 上调试?

我的环境

  • VSCode

  • npm-7.5.3

  • 节点-v14.15.4

  • Homebrew 3.0.1(arm)

答案1

  1. 在 homebrew 上重新安装 redis
  2. redis 服务器
  3. 纱线开发
  4. 工作

文章可能会有帮助

相关内容