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

NVM install fails with Invalid mirror or host unavailable for some ~/.curlrc files #223

Closed
bcspragu opened this issue Apr 26, 2024 · 2 comments · Fixed by #224
Closed

NVM install fails with Invalid mirror or host unavailable for some ~/.curlrc files #223

bcspragu opened this issue Apr 26, 2024 · 2 comments · Fixed by #224

Comments

@bcspragu
Copy link
Contributor

bcspragu commented Apr 26, 2024

The problem: nvm install was totally broken for me, showing an error like:

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now

This was a pretty maddening issue to debug (and ultimately entirely my fault) but the issue is here:

nvm.fish/functions/nvm.fish

Lines 116 to 117 in c69e5d1

if ! command curl $silent --progress-bar --location $url |
command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null

The problem is that if someone has a ~/.curlrc file that contains something like -w "\n" (to make output more readable), it breaks tar because tar isn't expecting the newline. The solution is just to make the curl call curl --disable, so that it doesn't read the .curlrc file at all.

@jorgebucaran
Copy link
Owner

That sounds pretty straightforward. Send me a PR with the fix that worked for you so I can test it in my environment.

bcspragu added a commit to bcspragu/nvm.fish that referenced this issue Apr 27, 2024
The idea is that a `~/.curlrc` can contain options that change the output, like `-w`, which can cause downstream tooling (like `tar`) to fail.

In this case, we want `curl` to behave consistently regardless of how the user has configured curl.

Fixes jorgebucaran#223
@bcspragu
Copy link
Contributor Author

Sounds good, sent out #224

jorgebucaran pushed a commit that referenced this issue Apr 28, 2024
The idea is that a `~/.curlrc` can contain options that change the output, like `-w`, which can cause downstream tooling (like `tar`) to fail.

In this case, we want `curl` to behave consistently regardless of how the user has configured curl.

Fix #223
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.

2 participants