Closed firrae closed 3 years ago
Based on the output, it looks like a newline processing issue -- something transformed \n
into \r\n
, which is causing bash
to interpret the \r
as a command. A number of things could have potentially caused an implicit newline transformation like that (most likely git configuration or UI or an IDE, or something odd about that variant of bash
).
It's a shot in the dark, but I see you're invoking the command from within a Windows filesystem (/mnt/c/Users/...
). That could be triggering some WSL magic, even though the asdf install script itself is mounted in a Linux filesystem. Maybe try running the install command from /home/steve
instead.
Barring that, you can strip out the superfluous \r
s with a quick sed -i'' -E 's|\r||g' /home/steve/.asdf/plugins/yarn/bin/install
(or your choice of any number of other methods, of course).
I'm curious what the root cause of the issue is, and whether it's anything the install script could take into account. Since the symptom is that the install script itself isn't readable, it seems unlikely a resolution would be entirely within the domain of the plugin. At least some documentation might come out of it, though, to help others who might encounter the same.
Hm, interesting thought @canterberry, I'll try it out tonight and see what happens on the Linux filesystem.
Hi @firrae , did you ever get a chance to try this out from the Linux filesystem? I'll also see if I can repro on my WSL environment.
@canterberry I have not sorry. life has been extremely busy recently. I will try to test it this weekend though as things begin to slow down a bit.
@canterberry Same error:
steve@DESKTOP-FAEGT4O:~$ asdf install yarn 1.22.5
/home/steve/.asdf/plugins/yarn/bin/install: line 2: $'\r': command not found
: invalid option namegins/yarn/bin/install: line 3: set: errexit
/home/steve/.asdf/plugins/yarn/bin/install: line 5: $'\r': command not found
/home/steve/.asdf/plugins/yarn/bin/install: line 6: syntax error near unexpected token `$'{\r''
'home/steve/.asdf/plugins/yarn/bin/install: line 6: `asdf_yarn_fail() {
Sorry for the delay in this, it's been crazy for me.
No worries, @firrae. Life happens!
I'm not quite sure what is going on, but it almost certainly has to do with some part of the toolchain adding \r
characters where they shouldn't be, and/or a bash
executable that does not sanely handle those characters. Either way, it wouldn't be something within asdf-yarn's jurisdiction, but nonetheless a relevant problem for this community to try and solve.
I've exhausted my immediate ideas, and invite others who may have more WSL 2 expertise to chime in case maybe this is a common or known issue with workarounds.
Closing due to inactivity.
Hi there, this might not be specific to WSL 2, but it seems when I try to run
asdf install yarn 1.22.5
(orlatest
) but I always get the following result:Any thoughts on what I'm missing, or is this another issue? I'm running
bash
inside: