farmOS / composer-project

2 stars 7 forks source link

Composer create-project fails with "Could not find package farmos/project with stability stable." #10

Open niiaboni opened 1 year ago

niiaboni commented 1 year ago

Describe the bug Unable to install farmos via composer. Failed with composer command and also with composer.json file on github

To Reproduce Steps to reproduce the behavior:

  1. Running the command "composer create-project farmos/project" in win 11 terminal produced following error: Creating a "farmos/project" project at "./project" Info from https://repo.packagist.org: #StandWithUkraine

In CreateProjectCommand.php line 424:

Could not find package farmos/project with stability stable.

  1. Tried to install with composer.json file from the github here. Got this error: composer create-project Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

    Problem 1

    • farmos/farmos[2.0.0-rc1, ..., 2.x-dev] require drupal/simple_oauth 5.2.3 -> satisfiable by drupal/simple_oauth[5.2.3].
    • farmos/farmos[2.0.0-beta8, ..., 2.0.0-beta8.1] require drupal/simple_oauth 5.2.2 -> satisfiable by drupal/simple_oauth[5.2.2].
    • farmos/farmos[2.0.0-beta6, ..., 2.0.0-beta7] require drupal/simple_oauth 5.0.6 -> satisfiable by drupal/simple_oauth[5.0.6].
    • drupal/simple_oauth[5.2.1, ..., 5.2.x-dev] require steverhoades/oauth2-openid-connect-server ^2.4 -> satisfiable by steverhoades/oauth2-openid-connect-server[v2.4.0, v2.5.0].
    • drupal/simple_oauth[5.0.3, ..., 5.0.x-dev] require lcobucci/jwt ^3.4 -> satisfiable by lcobucci/jwt[3.4.0, ..., 3.4.x-dev].
    • steverhoades/oauth2-openid-connect-server v2.4.0 requires lcobucci/jwt 4.1.5 -> satisfiable by lcobucci/jwt[4.1.5].
    • steverhoades/oauth2-openid-connect-server v2.5.0 requires lcobucci/jwt 4.1.5|^4.2 -> satisfiable by lcobucci/jwt[4.1.5, ..., 4.4.x-dev].
    • farmos/farmos[2.0.0-alpha1, ..., 2.0.0-alpha2] require npm-asset/farmos.org--farmos-map ^1.4 -> could not be found in any version, there may be a typo in the package name.
    • farmos/farmos[2.0.0-alpha3, ..., 2.0.0-beta5] require ext-simplexml ^7.4 -> it has the wrong version installed (8.2.4).
    • lcobucci/jwt[3.3.0, ..., 3.4.x-dev] require php ^5.6 || ^7.0 -> your php version (8.2.4) does not satisfy that requirement.
    • lcobucci/jwt[4.1.5, ..., 4.4.x-dev] require ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
    • Root composer.json requires farmos/farmos ^2.0 -> satisfiable by farmos/farmos[2.0.0-alpha1, ..., 2.x-dev].

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

To enable extensions, verify that they are enabled in your .ini files:

Expected behavior I expected farmOs files and dependencies to be downloaded to my local directory

Screenshots image image

Desktop (please complete the following information):

Additional context I used Composer version 2.5.5 2023-03-21 11:50:05

mstenta commented 1 year ago

Thank you for opening this @niiaboni. This came up recently in a farmOS forum topic: https://farmos.discourse.group/t/installing-on-ddev-via-composer/1646

The solution is to use the following command:

composer create-project farmos/project:2.x-dev

The reason this happens is because this composer-project repo does not have any tagged versions - only the 2.x development branch. That's why Composer complains without the 2.x-dev specified: Could not find package farmos/project with stability stable. - There is no "stable" package of farmos/project.

There probably should be - but that's a bigger topic. Hopefully this helps you get past this particular roadblock. :-)

mstenta commented 1 year ago

@niiaboni Can you open a separate issue for this please? It's not the same as the "Could not find package farmos/project with stability stable" error that this issue is focused on.

niiaboni commented 1 year ago

Thank you for opening this @niiaboni. This came up recently in a farmOS forum topic: https://farmos.discourse.group/t/installing-on-ddev-via-composer/1646

The solution is to use the following command:

composer create-project farmos/project:2.x-dev

The reason this happens is because this composer-project repo does not have any tagged versions - only the 2.x development branch. That's why Composer complains without the 2.x-dev specified: Could not find package farmos/project with stability stable. - There is no "stable" package of farmos/project.

There probably should be - but that's a bigger topic. Hopefully this helps you get past this particular roadblock. :-)

Thanks

mstenta commented 1 year ago

Thank you for opening https://github.com/farmOS/composer-project/issues/11 separately, @niiaboni!

I will keep this issue open for the time being so we remember to fix it.

jdschwam commented 1 year ago

May I suggest updating the below page with the above explanation. It took me some time to figure this out.

https://farmos.org/hosting/composer/

I will keep on exploring.... Thanks

mstenta commented 1 year ago

Thanks for bringing this up again @jdschwam. Updating the docs in the short-term makes sense. Do you want to open a PR? Here is the relevant file in GitHub: https://github.com/farmOS/farmOS/blob/2.x/docs/hosting/composer.md

mstenta commented 1 year ago

FYI I opened a draft PR which proposes a long-term solution to this: https://github.com/farmOS/farmOS/pull/739

mstenta commented 10 months ago

I merged a documentation change as a temporary fix. I'd like to leave this open while we consider https://github.com/farmOS/farmOS/pull/739, because I do think we should support the ability to simply run composer create-project farmos/project, rather than requiring the 3.x-dev version to be appended to the end.