DeepLcom / deepl-php

Official PHP library for the DeepL language translation API.
MIT License
202 stars 23 forks source link

Error while instaling: Your requirements could not be resolved to an installable set of packages. #3

Closed miguelgisbert closed 2 years ago

miguelgisbert commented 2 years ago

Hi, I received that error while installing:

miguel@miguel-IdeaPad-3-15ITL6:/var/www/html/vmo$ composer require deeplcom/deepl-php
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^0.4.0 for deeplcom/deepl-php
./composer.json has been updated
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package vendor/package could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package vendor/package2 could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package vendor/package3 could not be found in any version, there may be a typo in the package name.
  Problem 4
    - pelago/emogrifier v2.2.0 requires php ^5.5.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.3) does not satisfy that requirement.
    - pelago/emogrifier v2.2.0 requires php ^5.5.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.3) does not satisfy that requirement.
    - Installation request for pelago/emogrifier (installed at v2.2.0) -> satisfiable by pelago/emogrifier[v2.2.0].

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.

Installation failed, reverting ./composer.json to its original content.
miguel@miguel-IdeaPad-3-15ITL6:/var/www/html/vmo$

Any solution please?

Thank you, Miguel

diderich commented 2 years ago

I am successfully using composer version 2.3.5 to request and receive deeplcom/deepl-php. Maybe it is an issue of you still relying on version 1 of composer!?

miguelgisbert commented 2 years ago

Thanks for the answer, I managed to install it creating the json file inside the module folder. I couldn't upgrade composer either, don't know why.

Thanks, Miguel

daniel-jones-deepl commented 2 years ago

Hi @miguelgisbert, thanks for the question. Good to hear that you solved the problem.

I tested with Composer version 1, it works fine. However as @diderich said (and packagist.org in your console output), maybe you should use version 2. You could try a fresh install.

It seems to me the problem was due to your composer.json file -- you required packages vendor/package, vendor/package2 and vendor/package3; they seem to be placeholder or example names. The problem with pelago/emogrifier is unrelated, deepl-php package does not use this package. If this happens again you could try running composer validate or composer install first to check for and resolve problems in your composer.json file.