/bin/bash: --timeout: command not found on macos

Viewed 3538

I'm installing harbor with source code.

    ✗ make install

the error is below:

    ...
    Successfully built b917c04731a3
    Successfully tagged goharbor/nginx-photon:dev
    Done.
    /bin/bash: --timeout: command not found
    make[1]: *** [_build_registry] Error 127
    make: *** [build] Error 2

I've tried to get coreutils and config my path

    brew install coreutils
2 Answers

Edit :

The answer of @Arne Vogel is more likely to point the real problem.

Indeed it would be surprising that you don't have the command /bin/bash (so the steps I described here won't solve the issue).


coresutil is composed of GNU version of the most famous commands (cat, head, tail, wc, sort...), so it's not directly related to your problem.

You can use brew to install the latest version (version 5) of bash:

brew install bash

Double check if you really don't have a bash inside your /bin/:

sudo ls /bin/bash

It should returns a line like this (pay attention to the permission):

-r-xr-xr-x  1 root  wheel  618416 Nov 30 12:55 /bin/bash

If it returns no result, then you may create a link:

sudo ln -s $(which bash) /bin/bash

TBH, I don't know about harbor, but this error seems to be caused by bad formatting in a script, specifically something like:

some-command --some-option --some-other-option \
  --timeout

Now if the backslash (to continue the line) is missing, some-command will first be executed (without the --timeout option), and then bash will try to execute a command called --timeout, which, unsurprisingly, does not exist.

This problem can also be caused by an extraneous space after the backslash, a stray semicolon, wrong line terminators (in particular, Windows-style CRLF) etc.

Here are some suggestions for what you could do:

  • Make sure you have downloaded the source package appropriate for Mac OS X. Many open source packages are distributed in different formats, e.g. .zip and/or .7z for Windows, .tar.gz and/or .tar.bz2 for UNIX. You need either of the latter.
  • Check the documentation and/or forums, obviously.
  • If that doesn't help, use ktrace to find the offending script, and then look at it in a text editor. If you do find a bug in a script, consider reporting it to the developers.
Related