nodenv / node-build

Install NodeJS versions
MIT License
271 stars 80 forks source link

node-build fails using `aria2c` to download the tarball #777

Open jgnieuwhof opened 2 years ago

jgnieuwhof commented 2 years ago

Installations have consistently been failing on my Linux machine, Ubuntu 22.04.1, as follows:

Downloading node-v16.15.0-linux-x64.tar.gz...
-> https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.gz
error: failed to download node-v16.15.0-linux-x64.tar.gz
-> https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.gz
error: failed to download node-v16.15.0-linux-x64.tar.gz

BUILD FAILED (Ubuntu 22.04 using node-build 4.9.92)

Binary installation failed; try compiling from source with `--compile` flag

I verified that the URL is correct, it is. I then noticed in the source code that aria2c is the preferred HTTP client:

I uninstalled aria2c, and installation succeeded (presumably using curl):

Downloading node-v16.15.0-linux-x64.tar.gz...
-> https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.gz
Installing node-v16.15.0-linux-x64...
Installed node-v16.15.0-linux-x64 to /home/jgnieuwhof/.asdf/installs/nodejs/16.15.0

Don't know why.

Has this been seen before? Is there a reason why aria2c is the preferred client over curl or wget?

TheNicholasNick commented 1 year ago

thanks for the hint, sudo pacman -R aria2 and all fixed

checking aria2 manually

λ aria2c  https://nodejs.org/dist/v16.0.0/node-v16.0.0-linux-x64.tar.gz
12/23 14:14:16 [NOTICE] Downloading 1 item(s)
12/23 14:14:16 [ERROR] CUID#7 - Download aborted. URI=https://nodejs.org/dist/v16.0.0/node-v16.0.0-linux-x64.tar.gz
Exception: [AbstractCommand.cc:351] errorCode=19 URI=https://nodejs.org/dist/v16.0.0/node-v16.0.0-linux-x64.tar.gz
        -> [AbstractCommand.cc:789] errorCode=19 CUID#7 - Name resolution for nodejs.org failed:Could not contact DNS servers
12/23 14:14:16 [NOTICE] Download GID#801ec7a5a44dc0be not complete:                                                     
Download Results:                                t
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================                                         801ec7|ERR |        n/a|https://nodejs.org/dist/v16.0.0/node-v16.0.0-linux-x64.tar.gz                                                                                    t
Status Legend:
(ERR):error occurred.

can fix aria2 with an config file $HOME/.aria2/aria2.conf

async-dns=false

but this doesn't help asdf...

uninstall aria2c and don't use it if it is installed - it was a great tool, but it isn't being maintained and keep running into issues like this 😓