Saturday, March 4, 2017

Composer takes forever to download even with hirak/prestissimo?

Why does composer create-project take forever to download and create project?

I have tried:

Slim:

$ composer create-project slim/slim-skeleton slim-app

Laravel:

$ composer create-project laravel/laravel lavavel-app"5.0.*" --prefer-dist

It is just extremely slow:

Installing slim/slim-skeleton (3.1.2)
  - Installing slim/slim-skeleton (3.1.2) Downloading: 100%         
Created project in mr-simon-cohen-slim
Loading composer repositories with package information
Updating dependencies (including require-dev)
(it just stuck here...)

Any ideas?

I'm on Kubuntu 16.10.

EDIT:

After installing hirak/prestissimo, I get this error:

$ composer create-project slim/slim-skeleton slim-app

Cannot create cache directory /home/tealou/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/tealou/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/tealou/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/tealou/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
(it stuck here forever now)

During installing hirak/prestissimo, I get this error:

$ composer global require "hirak/prestissimo:^0.3"

Changed current directory to /home/teelou/.composer


  [ErrorException]                                                              
  file_put_contents(./composer.json): failed to open stream: Permission denied  

So i used sudo:

$ sudo composer global require "hirak/prestissimo:^0.3"
[sudo] password for teelou: 
Changed current directory to /home/teelou/.composer
Do not run Composer as root/super user! See https://getcomposer.org/root for details
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing hirak/prestissimo (0.3.5) Downloading: 100%         
Writing lock file
Generating autoload files

What can I do to fix this mess now?

EDIT 2:

I got it fixed by:

$ sudo chmod -R 777 /home/teelou/.composer/

But hirak/prestissimo does not help in speeding up the download at all. It is still very slow.



via teelou

Advertisement