-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
tar (child): xz: Cannot exec: No such file or directory
on brew gnu tar
#3034
Comments
Hmm, thanks, this is interesting. So you have |
I don't think so,
It appears that it does, at least looking at However, when I run the command directly with the ➜ bin git:(v0.39.3) tar -Jxf node-v18.14.0-darwin-arm64/node-v18.14.0-darwin-arm64.tar.xz
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now So it looks like the problem is with my system missing |
without Lines 4288 to 4340 in edacf82
|
Wouldn't that Unless I read that wrong, which is possible. I'm not a bash expert nor an nvm expert haha Edit: Although now I see |
This comment was marked as outdated.
This comment was marked as outdated.
GNU tar doesn't support using the -J flag required to unpack xz-compressed tarballs. This change means that anyone using GNU tar on MacOS will instead use gz-compressed tarballs. Fixes nvm-sh#3034
GNU tar doesn't support using the -J flag required to unpack xz-compressed tarballs. This change means that anyone using GNU tar on MacOS will instead use gz-compressed tarballs. Fixes nvm-sh#3034
GNU tar doesn't support using the -J flag required to unpack xz-compressed tarballs when xv isn't installed. Check for this scenario and fallback to using gzip-compressed tarballs. Fixes nvm-sh#3034
I've also run into this issue setting up a new Mac today. I'm using GNU versions of common tools like There's a potential PR at https://github.com/nvm-sh/nvm/compare/master...tim-mit:nvm:issue3034?expand=1 which I've tested to work for me. Instead of downloading the .xz tarball the .gz one is used and things unpack successfully. Happy to raise the PR if it's something you'd accept? |
That seems like it will work - so to reproduce on my Mac, i need to have GNU tar installed, but not xz? Don’t regular tar and xz both come on a stock Mac? |
Mac OS doesn't ship with the command line For me though (and I suspect quite a number of others) the first thing I do when setting up a Mac is install the GNU versions of command line tools and put them in front of the BSD tools on the path so they're used by default. I'm often jumping to linux machines and being able to rely on tools working the same way everywhere is less frustrating. Here's an example gist from someone showing how it can be done - https://gist.github.com/skyzyx/3438280b18e4f7c490db8a2a2ca0b9da. As
|
ah, gotcha - so i clearly installed xz specifically, but i don't have any of the GNU tools installed, so i haven't been able to reproduce this. I'd love a PR that addresses this :-) |
GNU tar doesn't support using the -J flag required to unpack xz-compressed tarballs when xv isn't installed. Check for this scenario and fallback to using gzip-compressed tarballs. Fixes nvm-sh#3034
This issue helped me understand what was happening with my fresh install of nvm versions - thank you folks. Uncommenting the line |
Operating system and version:
Mac osx 12.3 - M1 max chip
nvm debug
output:nvm ls
output:How did you install
nvm
?install script in readme
What steps did you perform?
nvm install 18
What happened?
Probably easiest to just show the output:
As I note below, I am using https://formulae.brew.sh/formula/gnu-tar instead of the mac built-in version. If I un-comment the line for adding gnu-tar to my path
nvm
works as expected.So I'm not blocked by this anymore since I only install new node versions... rarely. Wanted to bring it up since I didn't notice this in other issues.
output of
tar --version
(truncated license stuff):tar (GNU tar) 1.34
What did you expect to happen?
Install works with no errors
Is there anything in any of your profile files that modifies the
PATH
?.zshrc
does, notablyexport PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"
to addgnu-tar
to the path instead of the defaulttar
.The text was updated successfully, but these errors were encountered: