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.
Related
I can't install composer in Windows. The command prompt shows:
E:\Projects\l-api>composer install
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
I want to install laravel 2.2 through composer with
$ composer create-project --prefer-dist laravel/laravel sampleBackend 5.2
but every time i do that composer shows a message:
The
"http://packagist.org/p/provider-2014%2490c266c2df21924a932e564b7f39bf03d55b933fbe43744a6056eab59b7b4cf9.json"
file could not be downloaded: failed to open stream: HTTP request
failed! http://packagist.org could not be fully loaded, package
information was loaded from the local cache and may be out of date
Clear composer cache first by running
composer clear-cache
Then run this command
composer -vvv
This solution worked for me when I was trying to install laravel.
I can't get composer to work. It also fails when I try to deploy to Heroku.
$ composer update
[ReflectionException]
Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist
$ rm -r ~/.composer
$ composer global require fxp/composer-asset-plugin --no-plugins
Changed current directory to /home/Chloe/.composer
Using version ^1.1 for fxp/composer-asset-plugin
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing fxp/composer-asset-plugin (v1.1.4)
Downloading: 100%
Writing lock file
Generating autoload files
$ composer update
[ReflectionException]
Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist
I tried the steps in Composer throws [ReflectionException] Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist and Updating composer throws exception Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist, but it still fails.
I also ran composer self-update and it still doesn't work.
PHP 5.6.19, Composer version 1.1-dev, Composer version 1.0.2 2016-04-21 12:30:18
The problem is that you require a version of fxp/composer-asset-plugin that's now broken with composer >= 1.0.
"fxp/composer-asset-plugin": "^1.0",
Since you've installed it globally, you can remove it from your composer.json.
I had a similar error. Try
composer global require fxp/composer-asset-plugin --no-plugins
this worked for me
can you help me please? I want to install Laravel via composer create-project laravel/laravel in to the cms directory but Composer downloads it very very slow. Can you help me with it how to boost it?
Here is my terminal:
saidalo#Saidalo-Yodgoroff:/var/www/html$ composer create-project laravel/laravel cms "5.1.*"
Installing laravel/laravel (v5.1.33)
- Installing laravel/laravel (v5.1.33)
Downloading: 100%
Created project in cms
> php -r "copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing vlucas/phpdotenv (v1.1.1)
Downloading: 100%
- Installing symfony/var-dumper (v2.7.11)
Downloading: 100%
- Installing symfony/translation (v2.7.11)
Downloading: Connecting...
I don't know what to do!
Try
composer config --global repo.packagist composer https://packagist.org
to force https
There is a package to speed up your composer. It may be useful
Disable Xdebug
Turn it off and be happy.
Use Prestissimo
is a global Composer plugin that installs dependencies in parallel. It is crazy fast. It’s worth noting that Prestissimo requires cURL, which may not work behind certain firewalls or proxies. I haven’t run into any issues at all personally.
Source: composer speed up from laravel
Try hirak/prestissimo Composer plug-in. It will drastically reduce dependency installation process of any large project.
I disabled IPv6 on my network card it seems to have fixed it. Image below of what I unchecked, hope that helps.
Disable IPv6 Img Link
Trying to install Symfony2 via composer failer.
It'seems to be a access right issue :
cmd :
composer create-project symfony/framework-standard-edition /Users/anthonydiniro/WWW/win4u2.com
result:
Installing symfony/framework-standard-edition (v2.5.0)
- Installing symfony/framework-standard-edition (v2.5.0)
Downloading: 100%
[ErrorException]
copy(/Users/anthonydiniro/.composer/cache/files/symfony/framework-standard-edition/96cf36b581c9cd4827fe8c973080a6db085a49b6.zip): failed to open stream: P
ermission denied
Thanks for help
As always, the first good thing to try if you have encountered an error is to run
php composer.phar self-update
That will ensure the latest composer binaries. Then, run your installation again ;)
Try what jperovic said first!
otherwise try sudo composer create-project symfony/framework-standard-edition /Users/anthonydiniro/WWW/win4u2.com
If that doesn't work try sudo chmod 777 -R /Users/anthonydiniro/.composer/cache/