Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel command not found while using laravel command

I've recently installed composer and also installed laravel installer from composer from the commmand line just like they said in laravel documentation. But when I used the laravel command on the command line, it show error:

sh.exe": laravel: command not found

I also added environment variable in the path variable.

~/.composer/vendor/bin

But still the same error occurs while using the laravel command. I'm a laravel newbie and I'm stuck in laravel installation.I've searched lot of times but still could not get the solution. I've read lot of users' questions with the same problem and used their solutions but still could not fix this.

like image 860
Birendra Gurung Avatar asked Jun 16 '26 23:06

Birendra Gurung


2 Answers

Your path /c/xampp/php:~/.composer/vendor/bin is definitly wrong. Either you have to fix it (should be something like C:/{path_to_your_composer_directory}) or you can simply use composer create-project laravel/laravel --prefer-dist to install a new laravel project.

I would go with the 2nd option, because you don't have to configure something else.

like image 134
Koga Avatar answered Jun 19 '26 13:06

Koga


On windows system, please remove . from path (just before .Composer)

like image 34
infernaze Avatar answered Jun 19 '26 11:06

infernaze