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

Unable to download tar.xz file #1088

Open
ByLCY opened this issue Jan 8, 2024 · 1 comment
Open

Unable to download tar.xz file #1088

ByLCY opened this issue Jan 8, 2024 · 1 comment

Comments

@ByLCY
Copy link

ByLCY commented Jan 8, 2024

I want to download node v0.10.36, but there is no node-v0.10.36-darwin-x64.tar.xz file at https://nodejs.org/dist only node-v0.10.36-darwin-x64.tar.gz.

Would like to be able to specify fnm whether to download a .tar.xz file or a .tar.gz file.

image

RUST_LOG=debug fnm install 0.10.36

Installing Node v0.10.36 (x64)
[2024-01-08T09:02:50Z DEBUG fnm::directory_portal] Created a temp directory in "/Users/xxx/Library/Application Support/fnm/node-versions/.downloads/.tmpX2Gx8P"
[2024-01-08T09:02:50Z DEBUG fnm::downloader] Going to call for https://nodejs.org/dist/v0.10.36/node-v0.10.36-darwin-x64.tar.xz
[2024-01-08T09:02:50Z DEBUG reqwest::connect] starting new connection: https://nodejs.org/
[2024-01-08T09:02:50Z DEBUG rustls::client::hs] No cached session for DnsName("nodejs.org")
[2024-01-08T09:02:50Z DEBUG rustls::client::hs] Not resuming any session
[2024-01-08T09:02:50Z DEBUG rustls::client::hs] Using ciphersuite TLS13_AES_256_GCM_SHA384
[2024-01-08T09:02:50Z DEBUG rustls::client::tls13] Not resuming
[2024-01-08T09:02:50Z DEBUG rustls::client::tls13] TLS1.3 encrypted extensions: [ServerNameAck, Protocols([ProtocolName(6832)])]
[2024-01-08T09:02:50Z DEBUG rustls::client::hs] ALPN protocol is Some(b"h2")
error: Can't download the requested binary: v0.10.36 for x64 not found upstream.
You can `fnm ls-remote` to see available versions or try a different `--arch`.
@killjoy1221
Copy link

killjoy1221 commented Apr 30, 2024

I experience a similar issue. My node mirror doesn't provide .tar.xz downloads, even for the latest version. When using nvm, I can get around this by patching nvm_supports_xz() { return 1; } function in my bashrc to force it to download the .tar.gz file. I obviously can't do that with fnm.

Ideally, this function would need to return multiple URLs in order of preference (configurable?). i.e. xz -> gz

fnm/src/downloader.rs

Lines 38 to 45 in a5a497b

fn filename_for_version(version: &Version, arch: &Arch) -> String {
format!(
"node-{node_ver}-{platform}-{arch}.tar.xz",
node_ver = &version,
platform = crate::system_info::platform_name(),
arch = arch,
)
}

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

No branches or pull requests

2 participants