asdf-nodejs icon indicating copy to clipboard operation
asdf-nodejs copied to clipboard

Plugin nodejs's list-all callback script failed with output: env: bash\r: No such file or directory

Open Auxtal opened this issue 3 years ago • 3 comments

After running asdf list all nodejs I get the following error

Plugin nodejs's list-all callback script failed with output:
env: bash\r: No such file or directory

Any help would be greatly appreciated!

Auxtal avatar Jul 18 '22 06:07 Auxtal

Hi! @Auxtal, some problem here, how did I solve it? Look at the picture what worked for me.

image

roberto0arruda avatar Aug 11 '22 23:08 roberto0arruda

This sounds like a problem with line endings. asdf is written in Bash which expects LF line endings. Sounds like your plugin repos have been cloned with CRLF.

jthegedus avatar Aug 12 '22 00:08 jthegedus

Yes that did work thank you very much, LF lines it is from now on...

Correct me if I am wrong but you can add a .gitattributes file in the repo to prevent this happening in future. (https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/#normalizing-line-endings-in-git-with-gitattributes)

Auxtal avatar Aug 14 '22 07:08 Auxtal

We do this in the core - https://github.com/asdf-vm/asdf/blob/master/.gitattributes

I think we should do this with all our repos. PRs welcome.

Keep in mind there are scenarios where you want something different to the gitattributes automagic text=auto. While it is not recommended to use asdf in WSL on Windows mounted dirs, it is possible one would want to control this specifically per user, see this SO response

jthegedus avatar Aug 22 '22 15:08 jthegedus

Just added .gitattributes to the repo, it is the same one we are using on asdf-core, that should fix it. But we still should avoid using asdf on Windows dirs, the possibility of incompatibilities can go beyond just line endings

augustobmoura avatar Sep 02 '22 03:09 augustobmoura