/usr/bin/env: ‘bash\r’: No such file or directory

Priyal picture Priyal · Apr 18, 2019 · Viewed 15.4k times · Source

I am having an issue after setting up docker in Linux terminal in win10. When I am trying to build it shows following error.

/usr/bin/env: ‘bash\r’: No such file or directory
ERROR: Service 'magento2' failed to build: The command '/bin/sh -c /opt/docker/bin/service.d/autosync.sh install     && docker-service-enable autosync' returned a non-zero code: 127

Is it git line ending bug and how can I solve it?

Answer

Priyal picture Priyal · Apr 18, 2019

I solved it by finding that autosync.sh somewhere in my projects hidden and changed file format to Unix and boom it worked.