Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Composer Install doesn't work #23

Open
killrawr opened this issue Dec 18, 2017 · 9 comments
Open

PHP Composer Install doesn't work #23

killrawr opened this issue Dec 18, 2017 · 9 comments

Comments

@killrawr
Copy link

I've entered the command in Power Shell

composer require gossi/php-code-formatter

But it returns

  [InvalidArgumentException]
  Could not find package gossi/php-code-formatter at any version for your minimum-stability (stable). Check the packa
  ge spelling or your minimum-stability


require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
@gossi
Copy link
Member

gossi commented Dec 19, 2017

Since there is no release yet, it is only dev-master. You need to:

composer require gossi/php-code-formatter@dev-master

@jammer699669
Copy link

I tried that as well and it did not work

composer require gossi/php-code-formatter@dev-master
[InvalidArgumentException]
Could not find a matching version of package gossi/php-code-formatter@dev-master. Check the package spelling, your version constraint and that the package is available in a
stability which matches your minimum-stability (stable).

@gossi
Copy link
Member

gossi commented Apr 3, 2018

It has been a while since I last used composer. Back in these days dev-master was kinda whitelisted, against your composer.json minimum-stability setting. Don't know if this has changed. You might have a look here: https://getcomposer.org/doc/articles/versions.md#stability-constraints

@jammer699669
Copy link

I will try this
composer require gossi/php-code-formatter:"dev-master"

@jammer699669
Copy link

composer require gossi/php-code-formatter:"dev-master"
./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
- The requested package gossi/php-code-formatter No version set (parsed as 1.0.0) is satisfiable by gossi/php-code-formatter[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability.

@gossi
Copy link
Member

gossi commented Apr 3, 2018

Have you tried, in your composer.json ?

{
  "require": {
    "gossi/php-code-formatter": "dev-master@dev"
    ...
  }
}

@onet4
Copy link

onet4 commented Feb 19, 2022

Hello,

Same problem here.

With composer require gossi/php-code-formatter, I get

  [InvalidArgumentException]
  Could not find a version of package gossi/php-code-formatter matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.

With composer require gossi/php-code-formatter@dev-master, I get

  [InvalidArgumentException]
  Could not find a matching version of package gossi/php-code-formatter@dev-master. Check the package spelling, your
  version constraint and that the package is available in a stability which matches your minimum-stability (stable).

With

{
  "require": {
    "gossi/php-code-formatter": "dev-master@dev"
    ...
  }
}

, I get

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires gossi/php-code-formatter dev-master@dev -> satisfiable by gossi/php-code-formatter[dev-master].
    - gossi/php-code-formatter dev-master requires gossi/php-code-profiles dev-master -> found gossi/php-code-profiles[dev-master] but it does not match your minimum-stability.

@onet4
Copy link

onet4 commented Feb 19, 2022

After adding

  "minimum-stability": "dev",
  "prefer-stable" : true,

to composer.json, and running composer update, I get

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires gossi/php-code-formatter dev-master@dev -> satisfiable by gossi/php-code-formatter[dev-master].
    - Conclusion: don't install symfony/config v4.1.2 (conflict analysis result)
    - Conclusion: don't install symfony/config 5.2.x-dev (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.3 (conflict analysis result)
    - Conclusion: don't install symfony/config 5.3.x-dev (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.4 (conflict analysis result)
    - Conclusion: don't install symfony/config 5.4.x-dev (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.5 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.0-BETA1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.6 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.0-BETA2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.7 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.0-BETA1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.8 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.0-BETA1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.9 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.0-BETA2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.10 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.0-BETA3 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.11 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.0-BETA1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.1.12 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.0-BETA2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.0 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.0-BETA3 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.1 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.4.0-BETA1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.2 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.4.0-BETA2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.3 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.0-RC1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.4 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.0-RC1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.5 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.0-RC2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.6 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.0-RC1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.7 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.0-RC2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.8 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.0-RC1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.9 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.4.0-RC1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.10 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.0 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.11 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.2.12 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.0 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.3 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.1 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.4 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.2 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.5 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.3 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.6 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.4 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.7 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.5 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.8 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.6 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.9 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.7 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.10 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.8 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.0.11 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.9 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.0 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.10 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.3.11 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.0 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.3 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.1 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.4 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.2 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.5 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.3 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.6 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.4 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.7 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.5 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.8 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.6 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.9 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.7 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.10 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.8 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.1.11 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.9 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.0 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.10 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.1 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.11 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.12 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.3 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.13 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.4 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.14 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.7 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.15 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.8 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.16 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.10 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.17 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.11 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.18 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.2.12 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.19 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.0 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.20 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.22 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.3 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.23 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.4 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.25 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.10 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.26 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.11 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.27 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.13 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.30 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.3.14 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.33 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.4.0 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.34 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.4.2 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.36 (conflict analysis result)
    - Conclusion: don't install symfony/config v5.4.3 (conflict analysis result)
    - Conclusion: don't install symfony/config v4.4.37 (conflict analysis result)
    - gossi/php-code-formatter dev-master requires gossi/php-code-profiles dev-master -> satisfiable by gossi/php-code-profiles[dev-master].
    - gossi/php-code-formatter dev-master requires symfony/config ~2|^3|^4 -> satisfiable by symfony/config[2.0.4, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev].
    - You can only install one version of a package, so only one of these can be installed: symfony/config[2.0.4, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].
    - gossi/php-code-profiles dev-master requires symfony/config ^5.0 -> satisfiable by symfony/config[v5.0.0-BETA1, ..., 5.4.x-dev].
    - Conclusion: don't install symfony/config 5.1.x-dev (conflict analysis result)

@namaljayathunga
Copy link

namaljayathunga commented Aug 25, 2022

This worked for me (composer.json) then run composer install

{
    "repositories": [
        {
            "type":"package",
            "package": {
            "name": "phpowermove/php-code-formatter",
            "version":"master",
            "source": {
                "url": "https://github.com/phpowermove/php-code-formatter.git",
                "type": "git",
                "reference":"master"
                }
            }
        }
    ],
    "require": {
        "gossi/php-code-formatter": "master"
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants