Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Node v17.1.0 resolves localhost differently #375

Closed
yasushisakai opened this issue Dec 8, 2021 · 3 comments
Closed

Node v17.1.0 resolves localhost differently #375

yasushisakai opened this issue Dec 8, 2021 · 3 comments

Comments

@yasushisakai
Copy link

yasushisakai commented Dec 8, 2021

While the README recommends node's version to be 14, I tried 17.1.0 (that was installed in my system) and npm start did not work, giving the following error:

FetchError: request to http://localhost:8899/ failed, reason: connect ECONNREFUSED ::1:8899
    at ClientRequest.<anonymous> (/home/yasushi/code/solana/example-helloworld/node_modules/node-fetch/lib/index.js:1461:11)

This comes from the node resolving localhost to IPv6's ::1, not 127.0.0.1. This is totally from upstream, and does nothing to do with this example, but I suggest that it should be written stronger in the README.md that other versions of node may not work...

The current LTS 16.13.1 did work.

others have pointed out this behavior:
okTurtles/group-income#1108

@CalebEverett
Copy link
Contributor

CalebEverett commented Dec 19, 2021

This is failing even with node LTS 16.13.1

found 0 vulnerabilities
v16.13.1

...

Let's say hello to a Solana account...
FetchError: request to http://localhost:8899/ failed, reason: connect ECONNREFUSED ::1:8899
    at ClientRequest.<anonymous> (/home/runner/work/sol-hello2/sol-hello2/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (node:events:390:28)
    at ClientRequest.emit (node:domain:475:12)
    at Socket.socketErrorListener (node:_http_client:442:9)
    at Socket.emit (node:events:390:28)
    at Socket.emit (node:domain:475:12)
    at emitErrorNT (node:internal/streams/destroy:164:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}

@jstarry
Copy link
Contributor

jstarry commented Dec 21, 2021

Could one of you open a PR to fix this? Thanks for reporting!

@CalebEverett
Copy link
Contributor

this seemed like the minimal fix e58ed51

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

No branches or pull requests

3 participants