11

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?

Philippe Fanaro
  • 6,148
  • 6
  • 38
  • 76
Priyal
  • 633
  • 1
  • 8
  • 21
  • 2
    Git doesn't have a line ending bug. However, depending on your git settings, it might propagate Windows line endings into your Linux box. Read https://help.github.com/en/articles/dealing-with-line-endings (read both Linux and Windows page) to understand the issue to solve it long-term. Right now, it's easiest to use `dos2unix` and re-commit the file. – Amadan Apr 18 '19 at 06:59
  • if i run this command from terminal "/bin/sh -c /opt/docker/bin/service.d/autosync.sh install" it says "install: 1: install: /opt/docker/bin/service.d/autosync.sh: not found" – Priyal Apr 18 '19 at 07:38

3 Answers3

14

In VSCODE you can use: VSCODE Editor Bar

LF can be changed in CRLF and back

adl_B
  • 141
  • 1
  • 7
5

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

Priyal
  • 633
  • 1
  • 8
  • 21
2

You get this error message simply because the /dev folder is not in /bin. It is directly in the /flutter folder so change your path this way solve this problem:

export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter"
Philippe Fanaro
  • 6,148
  • 6
  • 38
  • 76
  • This is not working for me. When doing it this way the dart executable can not be found, obviously. – Marty Oct 29 '22 at 15:12