jorgebucaran / nvm.fish

The Node.js version manager you'll adore, crafted just for Fish
https://git.io/nvm.fish
MIT License
2.06k stars 69 forks source link

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

Closed bcspragu closed 3 months ago

bcspragu commented 4 months ago

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:

https://github.com/jorgebucaran/nvm.fish/blob/c69e5d1017b21bcfca8f42c93c7e89fff6141a8a/functions/nvm.fish#L116-L117

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 commented 4 months ago

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

bcspragu commented 4 months ago

Sounds good, sent out https://github.com/jorgebucaran/nvm.fish/pull/224