I was getting this error in the Broadsea content (nginx) module:
/tmp/envsubst.sh: 2:
:not found
Turns out, this is caused by git automatically changing linux new lines to windows new lines.
This is fixed by running this before cloning Broadsea:
git config --global core.autocrlf false