If you are getting this error when trying to install Laravel, then you have to do the following steps.
- Type open
- A text file will open. At the end of the file, add the following line of code:
export - PATH="$HOME/.composer/vendor/bin:$PATH".
- Save the file and close it.
- Now Laravel installer will work.