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

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

Open
niiaboni opened this issue Jun 8, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@niiaboni
Copy link

niiaboni commented Jun 8, 2023

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:
- C:\xampp\php\php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-simplexml --ignore-platform-req=ext-sodium to temporarily ignore these required extensions.

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

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser NA
  • Version NA

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

@niiaboni niiaboni added the bug Something isn't working label Jun 8, 2023
@mstenta
Copy link
Member

mstenta commented Jun 8, 2023

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 mstenta closed this as completed Jun 8, 2023
@mstenta mstenta changed the title Installing via Composer Composer create-project fails with "Could not find package farmos/project with stability stable." Jun 8, 2023
@mstenta mstenta reopened this Jun 8, 2023
@mstenta
Copy link
Member

mstenta commented Jun 15, 2023

@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
Copy link
Author

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
Copy link
Member

mstenta commented Jun 18, 2023

Thank you for opening #11 separately, @niiaboni!

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

@mstenta mstenta reopened this Jun 18, 2023
@jdschwam
Copy link

jdschwam commented Oct 7, 2023

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
Copy link
Member

mstenta commented Oct 11, 2023

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
Copy link
Member

mstenta commented Oct 23, 2023

FYI I opened a draft PR which proposes a long-term solution to this: farmOS/farmOS#739

@mstenta
Copy link
Member

mstenta commented Jan 4, 2024

I merged a documentation change as a temporary fix. I'd like to leave this open while we consider farmOS/farmOS#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.

@mstenta mstenta reopened this Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants