Composer does not install packages

Asked

Viewed 1,586 times

2

I recently installed Ubuntu on my machine and am preparing the environment to work with Laravel. Everything is working except that I can’t create the Laravel project when I run command

composer create-project laravel/laravel projeto

It keeps running endlessly, and nothing happens. No error message is displayed, and nothing is installed. I tried to download the Composer again and now it keeps making eternal donwload. As soon as I installed Ubuntu, I was able to do the Poser dowload, after that I made an update that Ubuntu was asking for and so I can’t use Composer anymore, I can’t say that the update is responsible for that. I appreciate all your help.

  • When you download the first time it creates a copy in the Composer folder, you may have installed it in an inaccessible folder. Tell me you came to try the Artisan command or enable it?

  • sudo composer create-project laravel/laravel projeto

  • sudo does not resolve Zoom I tried before.

  • @I did not try because nothing was installed. And I tried to install other packages with Composer and it happens the same, I tried a self-update and it happens the same, keeps running and never ends.

  • I got to clear the Composer cache too and did not solve, I downloaded a manual version of Composer.phar and tried to run it to download the packages and it did not work.

  • Wait, but are you trying to install something without installing the "initial" yet? Do the following just to be sure, use this command composer create-project --prefer-dist laravel/laravel projeto

  • @Guilhermenascimento the problem persists. The code I used above, had already worked other times, I picked it up on Laravel’s own website, and in an laracast video.

  • Already tried to install in another directory ?

Show 3 more comments

3 answers

5


the problem described here is related to Ipv6, just disable it, or give more prescience to Ipv4 to get back to work. For Ubuntu 14.04 use the following command.

sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

For more information visit the link: getcomposer.org

2

When you create a project Laravel should already be installed, you probably did not run the Installer, do it first of all:

composer global require "laravel/installer"

Then try creating a project using exactly this command with --prefer-dist:

composer create-project --prefer-dist laravel/laravel projeto

Reinstalling the Composer

I recommend you try uninstalling Composer if the commands don’t work, so delete the composer.phar and remove the /home/<user>/.composer.

And then reinstall:

curl -sS http://getcomposer.org/installer | php

-1

Probably Composer is trying to install everything, but its internet is slow, and then it is taking too long to download all packages.

Rotate the remote with -vvv to see what’s going on: composer create-project laravel/laravel projeto -vvv

  • My internet is 20mb, I do not believe it is a problem with the connection.

  • Sometimes the internet gets slow. Sometimes it’s a problem with Github. Still, try running the command with -vvv like I said. It’ll give you a log of what’s going on, and then it’s easier to figure out the problem.

  • @Frenetic thought cool the command -vvv, just a hint, to send a message to a user has to use the @nome do usuário, note that he has to be participating in the question, with comments or answers or questions.

  • @Frenetic couldn’t run the command because I removed Composer, testing the previous conversation. I will download a Composer manual version and test what you recommended.

  • Checking CA file /etc/ssl/Certs/ca-Certificates.crt Downloading https://packagist.org/packages.json Stays at this point.

  • @Ziruzanrgeiff OS date and time are right?

  • Yes it is correct. Both date and time. In the São Paulo team zone.

  • I did not negatively, actually I did not understand the negatives, seems to me a good tip, however I think the reason was because it is not a conclusive answer to the problem, but I can not say if it was that. Maybe you could turn into comment.

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.