Open efoken opened 4 years ago
@efoken interesting. As far as I know these plugins should install their dependencies to their own plugin directories, but we can look into it.
I got the same problem.
composer require wp-graphql/wp-graphql-jwt-authentication
Using version ^0.3.5 for wp-graphql/wp-graphql-jwt-authentication
./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: firebase/php-jwt[v4.0.0, v5.0.0].
- Can only install one of: firebase/php-jwt[v5.0.0, v4.0.0].
- Can only install one of: firebase/php-jwt[v4.0.0, v5.0.0].
- wp-graphql/wp-graphql-jwt-authentication v0.3.5 requires firebase/php-jwt ^4.0 -> satisfiable by firebase/php-jwt[v4.0.0].
- Installation request for wp-graphql/wp-graphql-jwt-authentication ^0.3.5 -> satisfiable by wp-graphql/wp-graphql-jwt-authentication[v0.3.5].
- Installation request for firebase/php-jwt (locked at v5.0.0) -> satisfiable by firebase/php-jwt[v5.0.0].
Installation failed, reverting ./composer.json to its original content.
@jasonbahl If I download the plugins as ZIP file and install them, of course, it works as all plugins have their own vendor
folder. But if one uses Bedrock and installs these plugins via Composer, all packages install their dependencies into the root vendor
directory, so that they can conflict
@efoken is there a way to configure composer.json to make sure these dependencies get installed into their respective project vendor folders? Unless I'm mistaken (@kidunot89 can clarify) WPGraphQL JWT Auth and WPGraphQL for WooCommerce aren't tightly coupled and should be able to run independently or together, regardless of their own composer dependencies.
If we could tell composer to install composer dependencies of the JWT plugin under the JWT plugin vendor directory, and the dependencies for WooGraphQL under the WooGraphQL vendor directory, that might solve the issue.
If WooGraphQL requires WPGraphQL JWT Auth to be active to use, then perhaps WooGraphQL could just remove the composer dependency altogether, document that WPGraphQL JWT Auth needs to be active, and then call the functions/classes that are included by that plugin being active?
I'm not opposed to updating the firebase dependency for this plugin, but I do think the 2 plugins should be able to iterate without a tight coupling to each other if we can make that happen.
@jasonbahl WooGraphQL using firebase/php-jwt
to create the Session tokens, but I hadn't don't any testing using the composer package. Is it possible to simply update WPGraphQL-JWT-Auth to 5.0
, I don't believe it'll cause any breaks code-wise.
@efoken Have you tried deleting your vendor
and composer.lock
and running composer install --no-dev
?
@jasonbahl Composer handles dependencies like that, we have only one vendor directory, so only one version of a package can be installed – no matter what. The only solution is to update firebase/php-jwt
to 5.x, the same version as it is used in wp-graphql
. I've created a PR for that #84
@kidunot89 I tried ;-)
I just tried to install this plugin in conjunction with the WPGraphQL WooCommerce addon, but Composer blocks installation because of
firebase/php-jwt
5.0 which is required by 'wp-graphql-woocommerce' and this package required version 4.0Note that I'm using Bedrock with Composer to install WordPress plugins and I'm installing WPGraphQL and addons using GitHub URLs.
Here's what Composer outputs: