I am currently setting up my laravel on my new machine. but when i tried to run composer global require laravel/installer it seems like the command was stuck on Changed current directory to C:/Users/sheer/AppData/Roaming/Composer. I waited for almost an hour to finish the installation but i am still stuck on this changed current directory part.
3 Answers
Install composer from there https://getcomposer.org/download/
Then run this command to create the Laravel project:
composer create-project --prefer-dist laravel/laravel blog "5.8.*"
when you try to use composer with gloab option , you mean that hey composer I want to save and have this type of dependency for future use ( something like laravel does ).
so it switches to it's installation folder and tries to install the dependency within it.
As you can see now the default directory for you is : C:/path/to/composer
which is not writable without admin permission on windows.
so you eaither have to change the installation directory of composer, which is not suggested or you have to Right Click on CMD
and click on Run As Administrator
.
check and see how it works.this type of problems are most of the times permission problems.
I encountered the same problem, when I navigated to the %USERPROFILE%\AppData\Roaming\Composer and found out that the vendor folder is not there but since there is a composer.json that requires laravel/installer, I opened up a terminal and run "composer install". After the installation, you will be able to run a command "laravel new project-name".
composer global diagnose
. – Rwd