Search code examples
macoslaravelterminalmamp

Having trouble trying to switch from MAMP to Laravel Vallet and using the Laravel command line tool


I'm having problems trying to use the Laravel command installer with Mac 10.10.5 Yosemite.

From my understanding I have too:

Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system.

So I tried exporting the $PATH in two different ways:

export PATH="~/.composer/vendor/bin/"
export PATH="$PATH:$HOME/.composer/vendor/bin

I installed the laravel installer and I do see that the directory exists for the Laravel installer:

 ~/.composer/vendor/bin/laravel/installer/...

The problem is when ever I use the laravel command I get:

-bash: laravel: command not found

I echo $PATH and I get this:

/Applications/MAMP/bin/php/php5.6.10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

I think there is something wrong with how the $PATH is set still. If I'm right how do I change this? If I'm wrong what do you think is going on?

I'm not going to try and install Vallet till I figure this out as I have a hunch that it won't work properly due to the same issue.


Solution

  • You will indeed need to add the composer path to your $PATH,

    Which can be done by adding:

    export PATH="$PATH:$HOME/.composer/vendor/bin"
    

    To your ~/.bash_profile

    This will add the path to your $PATH every time.