Andrei Pall

Linux Software Engineering

How to fix Laravel not found after running composer global require laravel/installer

The issue you're encountering is likely due to the global Composer bin directory not being added to your system's PATH. Here are the steps to resolve this:

  1. Find the Composer global bin directory:

    composer global config bin-dir --absolute
    # Output: /home/your-username/.config/composer/vendor/bin
  2. Edit the shell configuration file:

    nano ~/.bashrc
  3. Add the directory to the PATH:

    export PATH="$PATH:/home/your-username/.config/composer/vendor/bin"
  4. Apply the changes:

    source ~/.bashrc
  5. Verify the installation:

    laravel new my-application