[solved] Php dependencies conflicts doing an install via git

I am trying to setup Omeka S via a git install following the instructions in the git repository.

I am running into issues at the npx gulp init stage, they seem to be caused by some php dependencies clonflicts in composer.

I am running php version 7.4.3.

Any idea what is going wrong here?

Here’s the error i am getting:

$ npx gulp init
[08:32:50] Using gulpfile /var/www/html/omeka-s/gulpfile.js
[08:32:50] Starting 'init'...
[08:32:50] Starting 'dedist'...
[08:32:50] Finished 'dedist' after 48 ms
[08:32:50] Starting 'deps'...
You are already using the latest available Composer version 2.0.9 (stable channel).
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - ocramius/package-versions is locked to version 1.4.2 and an update of this package was not requested.
    - ocramius/package-versions 1.4.2 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it d
oes not match the constraint.
  Problem 2
    - omeka/composer-addon-installer is locked to version 1.0 and an update of this package was not requested.
    - omeka/composer-addon-installer 1.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it 
does not match the constraint.
  Problem 3
    - ocramius/package-versions 1.4.2 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it d
oes not match the constraint.
    - doctrine/orm v2.7.2 requires ocramius/package-versions ^1.2 -> satisfiable by ocramius/package-versions[1.4.2].
    - doctrine/orm is locked to version v2.7.2 and an update of this package was not requested.

ocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.
If you can not upgrade PHP you can require composer/package-versions-deprecated to resolve this with PHP 7.0+.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins o
r report a plugin-issue to ask them to support Composer 2.
[08:32:51] 'deps' errored after 866 ms
[08:32:51] Error: Command "php" exited with code 2
    at ChildProcess.<anonymous> (/var/www/html/omeka-s/gulpfile.js:78:28)
    at ChildProcess.emit (node:events:378:20)
    at ChildProcess.EventEmitter.emit (node:domain:532:15)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
    at Process.callbackTrampoline (node:internal/async_hooks:132:14)
[08:32:51] 'init' errored after 918 ms
npm ERR! code 1
npm ERR! path /var/www/html/omeka-s
npm ERR! command failed
npm ERR! command sh -c gulp "init"

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2021-02-18T08_32_51_378Z-debug.log

If i try to do composer update:

$ php build/composer.phar update
Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.
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 omeka/composer-addon-installer * -> satisfiable by omeka/composer-addon-installer[1.0]. 
    - omeka/composer-addon-installer 1.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

Ok after a lot of fiddling and hair pulling it seems i found something that worked.

The gulpfile is using the latest version of composer (2) but as the error messages said, something requires composer 1. Installing composer systemwide with apt does not work as gulp is using its own version. So i fooled the gulpfile (which i do not understand) by manually downloading the latest 1.x version of composer and putting it in the build directory as “composer.phar”.

Who knows maybe this will help someone down the line.

Yes, you put your finger on it, the issue is with the version of Composer.

I’m not sure which version you’re working with, but the current “develop” branch already has a fix for this problem (we specifically request Composer 1 when installing it for the first time). If you’re using an older tagged version, those were all released before Composer 2 existed and don’t have the fix.

1 Like

Thanks! It makes sense indeed that this version would have been released before the advent of composer 2. I got used to always working on a branch checked out from the latest tag from working on other projects, so i didn’t realize there could have been important fixes since.

Looking a bit further, this is a bug you have actually fixed in the code 4 months ago.
(https://github.com/omeka/omeka-s/commit/384af74916492131810807d8134a8ccfb124f278)

Thanks again!

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