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

Connection errors #520

Open
SharakPL opened this issue Aug 22, 2021 · 24 comments · May be fixed by #882
Open

Connection errors #520

SharakPL opened this issue Aug 22, 2021 · 24 comments · May be fixed by #882

Comments

@SharakPL
Copy link

SharakPL commented Aug 22, 2021

➜ ~ fnm list-remote
error: HttpError: error sending request for url (https://nodejs.org/dist/index.json): error trying to connect: dns error: failed to lookup address information: Try again
➜ ~ fnm install 14
error: Having a hard time listing the remote versions: error sending request for url (https://nodejs.org/dist/index.json): error trying to connect: dns error: failed to lookup address information: Try again

Maybe it uses wrong protocol or something. curl https://nodejs.org/dist/index.json got the output right away.

Installed on Termux (Android 11). Shell: zsh

@nickjwilde
Copy link

nickjwilde commented Mar 13, 2022

@SharakPL I had the same issue using termux android 12. I downloaded the linux binary from daily releases and installed manually

fnm list-remote

Gave me

error: error sending request for url (https://nodejs.org/dist/index.json): error trying to connect: dns error: failed to lookup address information: Try again

Curl was successful hitting https://nodejs.org/dist/index.json from termux.

I was able to get this working with a little tweak. Disclaimer: I am not a rust developer so there may be a better way to do this that's not so monkey patched.

  • I downloaded the source using 'git clone'.
  • I modified src/system_info.rs and pulled 2 functions out of [#cfg] blocks
pub fn platform_name() -> &'static str {
  "linux"                                            
}

And

pub fn platform_arch() -> &'static str {         "arm64"
}
  • Then run 'cargo build'
  • run 'cargo run -- list-remote' worked for me
  • I then installed locally using 'cargo install --path /path/to/fnm_source'

@Schniz not sure if any of this helps. I'm not super familiar with rust so I sorta hacked the solution to the problem.

Let me know if you have any questions about this.

@donaldxdonald
Copy link

donaldxdonald commented Mar 14, 2022

same issue
WSL( Ubuntu 20.04 )
Shell: zsh

Update
I had clone the repo and run cargo intall --path . and cargo build. Then replace ~/.fnm/fnm with ./target/release/fnm. It works. So maybe it is the install script issue.

@Schniz
Copy link
Owner

Schniz commented Mar 14, 2022

I don't have any Android devices. What OS arch is it? maybe there's a feature flag we need to provide by default? Another build pipeline in CI?

@acemasterjb
Copy link

I am also having the same issue @donaldxdonald is having.

System: WSL, Ubuntu 20.04
Shell: fish

if I wget the urls it is timing out on, it downloads the files fine, e.g.

fnm list-remote
error: error sending request for url (https://nodejs.org/dist/index.json): operation timed out

@tredmon
Copy link

tredmon commented Apr 10, 2022

If you use the patch by @nickjwilde it will successfully download node but the version it downloads will fail to run. To get it to work would require downloading node built specifically for Android, for which there are currently no official builds. Supporting android would thus also require either hosting node pre-built for android, or building node from source.

Also, if you want to use the correct cfg in that patch so it looks for the correct pre-built you would add

#[cfg(target_os = "android")]
pub fn platform_name() -> &'static str {
    "android"
}

My tests were from termux

$ uname -a
Linux localhost 4.9.292-g5f518a30d143-ab8080176 #0 SMP PREEMPT Fri Jan 14 10:23:32 UTC 2022 aarch64 Android

@latipun7
Copy link

I don't have any Android devices. What OS arch is it? maybe there's a feature flag we need to provide by default? Another build pipeline in CI?

@Schniz, I have this exact error when trying to install node in termux android. My android is aarch64, so, it should successfully downloading and installing node from this https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-arm64.tar.xz (arm64 / ARMv8).

From termux with zsh shell:

% uname -m
aarch64

Running curl -fsLS https://nodejs.org/dist/index.json is success.

@nikolalukovic
Copy link

I have this issue on fish in wsl2 ubuntu as well when trying to download x64 node versions...

@acemasterjb
Copy link

I have this issue on fish in wsl2 ubuntu as well when trying to download x64 node versions...

I actually had this issue as well on Windows 10, but due to some non-related circumstances I've since updated to Windows 11 and for some reason I was able to use fnm install <NODE_VERSION> just fine.

I'm not suggesting this as a solution, there is clearly something wrong with fnm on Windows 10 w/ wsl2. Just so that fnm contributors can see as well @nikolalukovic , which Ubuntu release are you on?

latipun7 added a commit to latipun7/dotfiles that referenced this issue Sep 7, 2022
@Livb-VRC
Copy link

still having this issue

@t-botz
Copy link

t-botz commented Dec 12, 2022

Same issue here. I am on WSL 2, Ubuntu 22.10, installed fnm with the standard script installation.
fnm ls-remote or any other command gives operation timed out.

curl'ing the url that time out for fnm works fine.
I am on zsh (shouldn't make any difference...).

t-botz added a commit to t-botz/fnm that referenced this issue Dec 13, 2022
Redoing Schniz#389 which was cancelled by Schniz#554 and reintroduced the error.

Fixes Schniz#520
@t-botz t-botz linked a pull request Dec 13, 2022 that will close this issue
@t-botz
Copy link

t-botz commented Dec 13, 2022

The operation timed out is definitely linked to musl. Same code base compiled for gnu, no problem, compiled for musl, timeout.

No idea why musl make it fail but I think compiling for musl is wrong (not needed and not well supported).

#882 Should fix this issue

@jmsherry
Copy link

This is still happening for me. (cURLing the URL for node distributions works)

Version: fnm 1.33.1
OS: Mac OS Ventura 13.1 (22C65)

fnm ls-remote

error: error sending request for url (https://nodejs.org/dist/index.json): error trying to connect: dns error: failed to lookup address information: nodename nor servname provided, or not known

@Ehimareo
Copy link

Who have solved this issue on termux running on Android 10? Still have this error "error: error sending request for url (https://nodejs.org/dist/index.json): error trying to connect: dns error: failed to lookup address information: Try again" when I type fnm install -- latest or fnm list-remote

@the-ult
Copy link

the-ult commented Sep 13, 2023

Same issue happening with Windows Powershell (v6)
Is there a solution?

@youguanxinqing
Copy link

I have solved it, but I don't know whether it woks for everyone. Installing fnm by cargo install fnm, I get error: error sending request for url (https://nodejs.org/dist/index.json): error trying to connect: tcp open error: No such file or directory (os error 2). Installing fnm by curl -fsSL https://fnm.vercel.app/install | bash, it works fine.

@yavorski
Copy link

yavorski commented Aug 26, 2024

Same issue on Arch, just installed fnm-bin from AUR ...

✖ fnm --version
fnm 1.37.1

✖ fnm list-remote
error: error sending request for url (https://nodejs.org/dist/index.json)

✖ fnm install '20.17.0'
Installing Node v20.17.0 (x64)
error: Can't download the requested binary: error sending request for url (https://nodejs.org/dist/v20.17.0/node-v20.17.0-linux-x64.tar.xz)

Edit: fnm from AUR built locally actually works

@waleiwalei
Copy link

Same issue on Arch, just installed fnm-bin from AUR ...

✖ fnm --version
fnm 1.37.1

✖ fnm list-remote
error: error sending request for url (https://nodejs.org/dist/index.json)

✖ fnm install '20.17.0'
Installing Node v20.17.0 (x64)
error: Can't download the requested binary: error sending request for url (https://nodejs.org/dist/v20.17.0/node-v20.17.0-linux-x64.tar.xz)

Edit: fnm from AUR built locally actually works

same with me today, i cannot install a node version

@fubd
Copy link

fubd commented Sep 4, 2024

same issue

2 similar comments
@zzzli
Copy link

zzzli commented Sep 14, 2024

same issue

@angelise7
Copy link

same issue

@vurtune
Copy link

vurtune commented Oct 14, 2024

Still same error 3 years later at 1.37.2 version.
Installed from curl in Termux

@shivarajnaidu
Copy link

shivarajnaidu commented Dec 27, 2024

I raised issue for the similar issue in ubuntu server which is trying to use proxy but fnm not able to connect
ISSUE: #1349

I am getting error: can't get remote versions file: error sending request for url (https://nodejs.org/dist/index.json)

It would be good if we can have option that will allow user to pass proxy through command line argument as well

@shivarajnaidu
Copy link

SOme other connection issues similar or related to this #1253 #1241 #1064

@MarquiseG
Copy link

Same issue

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.