Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"laravel: command not found" after installing Laravel

After I am using

composer global require laravel/installer

it seems the installation is success. For the second time, the result is:

Changed current directory to /home/ryanadhi/.config/composer
Using version ^3.1 for laravel/installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
13 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

then if I do

echo $PATH

the result is

    ~/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/ryanadhi/go/bin:/home/ryanadhi/.composer/vendor/bin

However if I try

laravel

the result is always:

laravel: command not found

like image 576
ryanadhi Avatar asked Feb 02 '26 22:02

ryanadhi


1 Answers

Editing the ~/.bashrc in Ubuntu 20.04 to reflect the path shown in the "Changed current directory to /home/ryanadhi/.config/composer" , message. fixed this for me.

first


 gedit ~/.bashrc

then edit the line

export PATH="/home/ryanadhi/.config/composer/vendor/bin:$PATH" 
like image 113
TeemO Avatar answered Feb 05 '26 12:02

TeemO