Econnrefused ::1:2368 Possible Node Install Conflict?

Environment:

  • OS: macOS, v14.1.2
  • Node Version: v18.12.1
  • Ghost Version: 5.41.0
  • Ghost-CLI Version: 1.24.0
  • Environment: development
  • Command: ‘ghost backup’

I will post the log below. I had a network filter on but shut it off with same result. This occurs when I attempt the following command: ghost backup.

Message: ‘connect ECONNREFUSED ::1:2368’

Stack: RequestError: connect ECONNREFUSED ::1:2368
at ClientRequest. (/opt/homebrew/lib/node_modules/ghost-cli/node_modules/got/source/request-as-event-emitter.js:178:14)
at Object.onceWrapper (node:events:628:26)
at ClientRequest.emit (node:events:525:35)
at origin.emit (/opt/homebrew/lib/node_modules/ghost-cli/node_modules/@szmarczak/http-timer/source/index.js:37:11)
at Socket.socketErrorListener (node:_http_client:494:9)
at Socket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Code: ECONNREFUSED
Path: /ghost/api/admin/authentication/setup/

What URL do you have set in your config? It looks like it’s being resolved to the ipv6 loopback (::1) but I expect Ghost is only listening on the ipv4 loopback (127.0.0.1).

If your URL is set as http://localhost:2368 you could try explicitly setting it as http://127.0.0.1:2368 or adjust your host setting to listen on all interfaces

"url": "http://localhost:2368",
"host": "0.0.0.0"

I’m surprised I didn’t pick up on that. I was experiencing problems with nvm and saw references to node. That is a solution—prevent it from resolving all together. Is this because my DNS server is pointing to an ipv6 address?