laravel command not found in mac os catalina

Viewed 3036

I am using Mac OS Catalina and I have already installed composer and laravel successfully. However, when I want to create a new laravel project via the terminal, it says zsh: command not found: laravel. Is this an operating system related issue?

Consider me a newbie, I'm not too sure what I have done wrong. Does anyone know how do I fix this?

1 Answers

This is likely due to not having Composer's vendor/bin directory in your path. You can add it to your path by running the code below.

You need to find out where composer is installing the vendor binaries first. This is usually in ~/.composer/vendor/bin or ~/.config/composer/vendor/bin.

echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.zshrc
source ~/.zshrc
Related