Drush doesn't update on one of two servers - windows

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.

Related

Issue when installing composer on Ubuntu server

I Want to install laravel app and I user composer like this to install packages
composer install
And I get this error
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/dbal 3.3.5 -> satisfiable by doctrine/dbal[3.3.5].
- doctrine/dbal 3.3.5 requires composer-runtime-api ^2 -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
I search any solution on the web without succes.
I'm on ubuntu server 20.04
Thank you
you have to upgrade the composer to version ^2.
run this command before "composer install"
=> composer self-update --2

Your requirements could not be resolved to an installable set of packages - laravel / valet

I am running this command on the terminal:
composer global require laravel/valet
but I got this error message:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- friendsofphp/php-cs-fixer is locked to version v2.16.4 and an update of this package was not requested.
- friendsofphp/php-cs-fixer v2.16.4 requires php ^5.6 || ^7.0 -> your php version (8.1.5) does not satisfy that requirement.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/valet:*" to figure out if any version is installable, or "composer require laravel/valet:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I search on google but couldn't find any solution.
PHP version I am running is 8.08 on MAMP
How can I solve it?
Run composer global require laravel/valet:*.
This will check any installable version is available for your dev environment and install the package.

Cannot install "Remove Unused Files" for Drupal

Instructions for https://www.drupal.org/project/remove_unused_files from #zealialize is to install via composer;
composer require 'drupal/remove_unused_files:^1.0#beta'
Getting this;
-bash-4.2$ composer require -W 'drupal/remove_unused_files:^1.0#beta' ./composer.json has been updated Running composer update
drupal/remove_unused_files --with-all-dependencies Loading composer
repositories with package information Updating dependencies Your
requirements could not be resolved to an installable set of packages.
Problem 1
- drupal/remove_unused_files[1.0.0-beta1, ..., 1.0.0-beta2] require drush/drush ^9.0 -> found drush/drush[9.0.0, ..., 9.7.3] but
it conflicts with your root composer.json require (^10.6).
- Root composer.json requires drupal/remove_unused_files ^1.0#beta -> satisfiable by drupal/remove_unused_files[1.0.0-beta1, 1.0.0-beta2].
Installation failed, reverting ./composer.json and ./composer.lock to
their original content.
Does this mean I have to revert drush to version 9.0 in order to install "unused_files" extension?

Install package composer require yajra/laravel-oci8 but got some error

I want to install a package with composer require yajra/laravel-oci8:^8. I'm using Laravel 8.10.0, it seems that the package supports that version but the following error appears:
How to solve this?
composer require yajra/laravel-oci8:^8
./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
- Installation request for yajra/laravel-oci8 8 -> satisfiable by yajra/laravel-oci8[v8.0.0].
- yajra/laravel-oci8 v8.0.0 requires ext-oci8 >=2.0.0 -> the requested PHP extension oci8 is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
Go to check with this PR and follow the instruction:
https://github.com/yajra/laravel-oci8/issues/429

Composer Google API Download Failed

I tried to download google api using composer to a legacy code but, the following error appeared:
composer require google/apiclient:^2.0
./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
- Installation request for google/apiclient 2.0 -> satisfiable by google/apiclient[v2.0.0].
- google/apiclient v2.0.0 requires google/auth 0.8 -> satisfiable by google/auth[v0.8].
- Conclusion: don't install guzzlehttp/psr7 1.4.2
- google/auth v0.8 requires guzzlehttp/psr7 1.2.* -> satisfiable by guzzlehttp/psr7[1.2.0, 1.2.1, 1.2.2, 1.2.3].
- Can only install one of: guzzlehttp/psr7[1.2.0, 1.4.2].
- Can only install one of: guzzlehttp/psr7[1.2.1, 1.4.2].
- Can only install one of: guzzlehttp/psr7[1.2.2, 1.4.2].
- Can only install one of: guzzlehttp/psr7[1.2.3, 1.4.2].
- Installation request for guzzlehttp/psr7 (locked at 1.4.2) -> satisfiable by guzzlehttp/psr7[1.4.2].
Installation failed, reverting ./composer.json to its original content.
What should I do?
Try removing vendor/google and then run composer install again, this worked for me.
Can only install one of: guzzlehttp/psr7[1.2.3, 1.4.2].
Your dependencies led to confusion of two different major versions of the package, but only one can be installed.
The locked at 1.4.2 message means this package has been already installed as per your composer.lock file, and you're trying to install different version not compatible with your existing criteria.
$ composer show -a google/auth | grep psr7
guzzlehttp/psr7 ~1.2
You can check which existing package depends on the locked version by checking the dependency tree:
composer show -t
In some cases, removing composer.lock may help.
Otherwise, to see why (from where) the package is referenced, run:
composer why guzzlehttp/psr7 -t
See also: How to resolve a "Can only install one of:" conflict?
I finally found a solution for me, it works just removing composer.lock!!

Resources