NEF_emulator error: /usr/bin/env: ‘sh\r’: No such file or directory

Host environment:

  • Windows 10,
  • git-bash
  • Docker-for-Windows

The error occurs after a “clean” installation (git clone + build-no-cache):

Any possible way to fix this?

The actual problem: it has to do with git-bash and the characters used by Windows for new lines (CR/LF instead of simple LF used by UNIX). Depending on the settings you have, git-bash replaces LF with CR/LF when you git clone the repository and then the container fails to start. That’s what we experienced in 2 of our Windows machines.

Solution: (it worked for us) to change a git-bash setting called “autocrlf” to false to prevent the above behavior. The command we used is: git config --global core.autocrlf false. After changing the configuration, git clone the repo again and follow the installation steps once more.

1 Like