How to get the required version of the Composer Plugin API? - composer-php

It is necessary to do the following:
composer self-update
composer global require "fxp/composer-asset-plugin:*"
But after executing the composer self-update, an error pops up:
The "hirak/prestissimo" plugin was skipped because it requires a Plugin API version ("~1.0.0-alpha10") that does not match your Composer installation ("1.1.0"). You may need to run composer update with the "--no-plugins" option.
My current version of Composer is 1.4.2
For the same reason, the following commands do not work:
composer global require "fxp/composer-asset-plugin:*"
An error pops up:
The "hirak/prestissimo" plugin was skipped because it requires a Plugin API version ("~1.0.0-alpha10") that does not match your Composer installation ("1.1.0"). You may need to run composer update with the "--no-plugins" option.
How to get the required version of the Composer Plugin API?

You just need to update hirak/prestissimo:
composer global update hirak/prestissimo --no-plugins

Related

how to install illuminate/mail via composer in Lumen

A setting mail-in on lumen project, I should install illuminate\mail via composer, but show me an error:
Your requirements could not be resolved to an installable set of packages
You can install through composer using the following command in the terminal:
composer require illuminate/mail
Make sure you are in the project directory.

Composer update fails with "drush/drush 9.6.0 requires symfony/yaml ^3.4 -> satisfiable by symfony/yaml[3.4.x-dev]"

I have a custom installation of Drupal that is managed by Composer. I executed composer outdated
That displayed some outdated packages. (see below)
I picked symfony/yaml and executed composer require symfony/yaml
My question is this: How do I resolve "Problem 1" shown in the screenshot.
I assumed "-> satisfiable by...symfony/yaml v4.3.0" and ran composer require symfony/yaml:v4.3.0
Still more errors... very much the same.
The package drush/drush requires a v3.4.x version of symfony/yaml and thefore conflicts with your request to update symfony/yaml to version 4.3.x.
There are simple solutions as drush/drush is a development tool.
Remove the require-dev dependency to drush/drush ...
composer remove 'drush/drush'
... and install the drush cli globally:
composer --global require 'drush/drush'
Even better: Use a tool like composer-bin-plugin to circumvent the dependency conflict in your global requirements:
composer remove 'drush/drush'
composer --global require bamarni/composer-bin-plugin
composer --global bin drush require 'drush/drush'
Further options to install drush globally without dependency conflicts are tools like cgr or phar.io's phive.
More information about this topic can be found in composer/composer issue #5390.

How do I do updates for my laravel project?

What command can I use to see a list of all my installed packages and do the update ? (through the terminal)
If you have composer run in the console
composer show --installed
For updating all your dependencies run in the console
composer update
To show installed packages run: composer show --installed
To update installed packages run: composer update
And Read these documents this and this

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
[...]

Resources