Skip to content

Unable to download tar.xz file #1088

Closed

Description

@ByLCY

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`.

Activity

  1. mattmess1221 commented on Apr 30, 2024

    @mattmess1221
    Contributor

    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,
    )
    }

  2. added a commit that references this issue on Jul 17, 2024
    6e42e3f
  3. added a commit that references this issue on Oct 6, 2024
    74d7c33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions