2

When I try to build my project on the Mac I get the error: zsh: code not found: build.sh

I use IntelliJ and Docker.

Anyone have any idea how to fix this?

Tried some different things already:

djm.im
  • 3,295
  • 4
  • 30
  • 45
Anna
  • 61
  • 1
  • 4

2 Answers2

1

Your shell doesn't know what is build.sh.
Execute this ./build.sh

If a file is not executable, you need to make it with this command sudo chmod +x build.sh

djm.im
  • 3,295
  • 4
  • 30
  • 45
  • I ran `sudo chmod +x build.sh` following `./build.sh`. Got this message: `zsh: ./build.sh: bad interpreter: /bin/bash^M: no such file or directory` – Anna Oct 07 '21 at 10:35
  • At first glance, `bad interpreter: /bin/bash^M` - it looks like a new line character problem. Take look https://stackoverflow.com/questions/14219092/bash-script-and-bin-bashm-bad-interpreter-no-such-file-or-directory – djm.im Oct 07 '21 at 14:57
1

Add permission to execute which you did already with chmod +x *.sh (try to avoid that since it gives permission to execute to all scripts, including ones that you don't want to be executable; Instead write specific file name - in your case chmod +x build.sh)

You can execute scripts with ./scriptname.sh for example ./build.sh - you did it before but without execute rights which now your script has.

Cepheon
  • 50
  • 8