Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: connect ECONNREFUSED 127.0.0.1:6379 #55

Open
philcoul opened this issue Jan 11, 2023 · 5 comments · May be fixed by #61
Open

Error: connect ECONNREFUSED 127.0.0.1:6379 #55

philcoul opened this issue Jan 11, 2023 · 5 comments · May be fixed by #61

Comments

@philcoul
Copy link

Hi
I unzip the files and folders in a directory and run
npm install
node run start
The server crashed. Did I miss anything

PS D:\Programming\nodeJS\tutorial\ws\chatCord> npm run dev

[email protected] dev
nodemon server

[nodemon] 2.0.2
[nodemon] to restart at any time, enter rs
[nodemon] watching dir(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node server.js
Server running on port 3000
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);

Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1283:16)
Emitted 'error' event on Commander instance at:
at RedisSocket. (D:\Programming\nodeJS\tutorial\ws\chatCord\node_modules@node-redis\client\dist\lib\client\index.js:338:14)
at RedisSocket.emit (node:events:513:28)
at RedisSocket._RedisSocket_connect (D:\Programming\nodeJS\tutorial\ws\chatCord\node_modules@node-redis\client\dist\lib\client\socket.js:119:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Commander.connect (D:\Programming\nodeJS\tutorial\ws\chatCord\node_modules@node-redis\client\dist\lib\client\index.js:162:9)
at async D:\Programming\nodeJS\tutorial\ws\chatCord\server.js:28:3 {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6379
}

Node.js v19.2.0
[nodemon] app crashed - waiting for file changes before starting...

@ghost
Copy link

ghost commented Jan 12, 2023

Same thing happened with me

@philcoul
Copy link
Author

Hi, I noticed that in the last version of the server.js from brad had the 'redis' package and much more. To get rid of this I used the code from 01Leviathan10 and it worked. Just need to update the package.json with the latest versions of packages like below and you are all set.
https://github.com/bradtraversy/chatcord/network/members

"dependencies": {
"express": "^4.18.2",
"moment": "^2.29.4",
"socket.io": "^4.5.4"

@bhaktitud
Copy link

bhaktitud commented Apr 16, 2023

hey you need to install docker,
just add a file called docker-compose.yml in the root of your project

and add the snippet bellow inside the file

version: "3"

services:
  redis:
    image: redis:5
    ports:
      - "6379:6379"

make sure your docker desktop is up and running,

now run this command in your terminal

docker-compose up -d

and finally run the server

npm run dev

@danielmeyer-hash
Copy link

i still have the same problem i dont know what to do

@ragnarbull
Copy link

@bhaktitud I made a PR to fix Redis see: #61

@danielmeyer-hash if you follow the comment above you it works perfectly. Or clone the project with my PR and setup Docker desktop and it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants