How to fix composer nothing to install &laravel cmd not found&Permission denied

Опубликовано: 02 Ноябрь 2024
на канале: ZINA TAKLIT
6,673
21

Salam
we gonna see today how to fix some issues once trying to install
laravel using composer:

composer global require "laravel/lumen-installer"

u may face that error :
Changed current directory to /Users/MYUSERNAME/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

and once u trying to run laravel new project

u will see
bash: laravel: command not found

Let's try to solve that :
first of all u may type
composer clear-cache
and then composet install ot update and i will work fine.

if that does not work so u have to

to that just type :
sudo gedit ~/.bash_profile
and past
export PATH=~/.composer/vendor/bin:$PATH
or
export PATH=~/.config/composer/vendor/bin:$PATH
if the composer located in ./config

Lets see that together :


If it works then fine.


Sometimes that does not work
and once u trying to create ur project in one directory it still
always the same error
or even when u type
composer create-project --prefer-dist laravel/lumen project_name

u will find that error
[ErrorException]
mkdir(): Permission denied

well to fix that error u have 2 possibilities

first one
sudo chmod 777 -R /whre_do_u_want_create_ur_prject
second one
type:
sudo chmod a+x `which composer`

both of them are scured
i have tryed both of them and it work:

finally solved 7amdAllah.




Note to chek if composer situed in .config or not
just cd home/user_name
ls -al
if u see .composer ok esle u will find .config then cd config then ls
: u will find theire composer ok .


Useful link:
https://stackoverflow.com/questions/2...

https://laracasts.com/discuss/channel...