Composer always fails to install symfony/var-dumper - laravel

I'm trying to install the latest version of Laravel 8 on the latest version of Homestead. When I run composer install or composer update, installation of symfony/var-dumper always fails:
Installing symfony/var-dumper (v5.2.6): Extracting archive
Install of symfony/var-dumper failed
[ErrorException]
file_get_contents(/home/vagrant/code/vendor/symfony/var-dumper/Resources/bin/var-dump-server):
Failed to open stream: No such file or directory
Despite the error exception, the file /vendor/symfony/var-dumper/Resources/bin/var-dump-server does exist.
Things I've tried:
Deleting the lock file and re-running composer update
Manually specifying specific versions of var-dumper, e.g. composer require symfony/var-dumper:5.2.0
I always get the same errors.

Remove /vendor folder, then run:
composer update -v

This turned out to be a compatibility issue with Composer 2.x. I downgraded to the 1.x channel using composer self-update --1, then ran composer install again, and the installation succeeded.

Composer version 2.2.4 2022-01-08 12:30:42
and
symfony/var-dumper v5.4.3
is working just fine

Related

Drush doesn't update on one of two servers

I have 2 different Windows 2016 Servers running Drupal 8 and Drush 9 is installed on both but I have a Drush verison mismatch that I'm trying to fix.
I have this global composer.json file on both servers:
{
"require": {
"drush/drush": "9.*"
}
}
On my Test server, drush --version shows version 9.5.2.
On my Live server, drush --version shows version 9.7.0.
If I run composer global update drush/drush on my Test server, it doesn't update Drush and returns, "nothing to install or update".
I tried this:
composer global require drush/drush:9.7.0
and got this error:
Changed current directory to C:/Users/username/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: consolidation/site-alias[3.0.0, 1.1.11].
- Can only install one of: consolidation/site-alias[3.0.0, 1.1.11].
- Can only install one of: consolidation/site-alias[3.0.0, 1.1.11].
- drush/drush 9.7.0 requires consolidation/site-alias ^3.0.0#stable -> satisfiable by consolidation/site-alias[3.0.0].
- Installation request for drush/drush 9.7.0 -> satisfiable by drush/drush[9.7.0].
- Installation request for consolidation/site-alias (locked at 1.1.11) -> satisfiable by consolidation/site-alias[1.1.11].
Installation failed, reverting ./composer.json to its original content.
Comparing the line, "name": "consolidation/site-alias", in composer.lock in both environments, I see that Test has 1.1.11 and Live has 3.0.0.
I installed drupal/recommended-project and thought I followed the same steps on both so I'm not sure how they got out of sync. Any ideas?
What is the recommended fix?
I ran composer require drush/drush and now both are on version 10.2.x.

ORO-CRM Composer Install - Failed to download composer/composer

For Install OroCRM in windows i have followed -> https://stackoverflow.com/a/40929643/8416476 after successful the command git clone -b 1.9.0 https://github.com/orocrm/platform-application.git orocrm then i try to run composer install --prefer-dist --no-dev Here i am getting error.
Installing composer/composer (1.0.0-p1): Downloading (failed) Failed to download composer/composer from dist: The
"https://api.github.com/repos/orocrm/composer/zipball/833ce984264204e7d6576ab082660105c7d8f04c"
file could not be downloaded (HTTP/1.1 404 Not Found)
How can i solve the issue.
Note : OroCRM in Windows
Install composer globally using https://getcomposer.org/Composer-Setup.exe
Then just run composer install --prefer-dist --no-dev from within application folder. This error is very odd and why are you trying to download 1.9.0 version? It is copy paste error or you specifically need this one?
Try Linux platform with Xampp for better convenient. refer https://oroinc.com/orocrm/doc/current/system-requirements#system-requirements

composer require laravel/dusk error

I am trying to install Laravel/Dusk on a laravel 5.4 application.
The command that I am running is, according to the documentation: https://laravel.com/docs/5.4/dusk
composer require laravel/dusk
The output in terminal:
Using version ^1.0 for laravel/dusk
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing facebook/webdriver (1.3.0)
Loading from cache
- Installing laravel/dusk (v1.0.10)
Downloading: 100%
Killed
That Killed is what's bothering. So, the package is being added to my composer.json file but no files can be found in vendor/laravel/dusk
I am trying to install this on my webhost and not on my local environment.
Any ideas?
The error is due to your machine on the host running out of memory, like described on this thread: https://github.com/composer/composer/issues/1815
So you may have to increase the performance on your account to be able to run more composer commands from your webhost.

Composer doesn't run in presence of composer.json

I installed composer globally on my Debian server
~$ which composer
/usr/local/bin/composer
It works, gets updated and I used it for three different (Symfony) sites.
~$ composer self-update
You are already using composer version 1.3.3 (stable channel).
However, when I am in the directory of one of the sites, and try to update all dependencies, I get an error (before, this just worked and updated the vendors etc).
~/website-path$ ls composer.*
composer.json composer.lock
~/website-path$ composer update
[ErrorException]
Illegal string offset 'version'
~/website-path$ composer
[ErrorException]
Illegal string offset 'version'
When I rename composer.json, this Error disappears (but the lack of .json file makes this quite useless)
What went wrong here and how can I fix this?
The problem magically went away overnight by upgrading to 1.4.0
~$ composer -V
Composer version 1.4.0 2017-03-08 17:51:24
~/website-path$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
[...]

Swiftmailer Error Composer Install

i am installing composer dependencies by 'composer install'.
it download bunch of packages but after swiftmailer it gives me error
[UnexpectedValueException]
'C:\Users\DELL\Downloads\laravel-4\vendor/swiftmailer/swiftmailer/72e34d......54c82f.1' is not a zip archive.
what does it mean?
For me this problem happened due to the order composer was installing the files.
The work around that worked for me was to go into \vendor\composer\autoload_real.php and comment out the following line
require $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php';
and then run composer again
Running composer install with the --prefer-source option, fixed this problem for me.

Resources