I can't install Flarum extensions

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 11.3.0.2
What app is this about: Flarum

Describe your issue

I’m getting the same error when I try to install ant flarum extension. Its says Your requirements could not be resolved to an installable set of packages. and some other things

Share relevant logs or error messages

I can’t see it on logs page

Take care, you should not use root user as said in the message !
You see un the log your php version (7.4.33) does not statisfy that requirement, because root will use the php version of the system (here Debian 11 I imagine), but the package Flarum use php8.2.

You should before enter in a shell for flarum and you will use the user flarum in his directory.

yunohost app shell flarum

then you can verify php version in the shell

php -v

and try execute your composer command

I did it. it’s saying php verison is 8.2 but I’m getting the same error when I try to execute the install command

Sometime is just stupid because if php8.2.xx it is not explicite for the script looking for php8.2, but if possible add more logs if you want help…
I not sure I could really help you, I did not use flarum.

I was already trying it for testing, it’s not a big problem. Thanks for your support

Have you seen this How to intall chat extensions for Flarum - #3 by tituspijean

means in the shell should be php composer.phar require vendor/extension

But here why you are using a “*” ?

When I run the command without “*” it says You can also try re-running composer require with an explicit version constraint, e.g. "composer require flarum/extension-manager:*" to figure out if any version is installable, or "composer require flarum/extension-manager:^2.1" if you know which you need. because of it I’m using it

Ok…

If you’re using * as the version string for extensions as is recommended, running the commands listed in the Flarum upgrade guide should update all your extensions.


Screenshot

root@host:/var/www/flarum#  composer require flarum/extension-manager:"*"
Do not run Composer as root/super user! See https://getcomposer.org/root for details 
Continue as root/super user [yes]?
./composer.json has been updated
Running composer update flarum/extension-manager
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- flarum/core is locked to version v1.3.9 and an update of this package was not requested
- flarum/core v1.8.9 requires laminas/laminas-diactoros ^2.4.1 || ^3.0.0 -> satisfiable by laminas/laminas-diactoros[3.5.0].
- laminas/laminas-diactoros 3.5.0 require php ~8.1.0 || ~8.2.0 || ~.8.3.0 || ~8.4.0 -> your php version (7.4.33) does not satisfy that requirement.

Don’t run composer as root. Instead, enter app shell by invoking sudo yunohost app shell flarum and there invoke the composer, most likely prefixing it with an appropriate php interpreter version (8.2 for flarum), so

COMPOSER_HOME="~/.composer" COMPOSER_MEMORY_LIMIT=-1 php8.2 "~/composer.phar" require flarum/extension-manager:"*"  -d "~"

and hope for the best :person_shrugging:

1 Like

Thanks you it worked!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.