1

I am stuck on trying to do an OS install and following the install guide found here.

When attempting to use Composer2 to fetch I get the following errors.

  Problem 1
    - drupal-composer/drupal-scaffold is locked to version 2.6.1 and an update of this package was not requested.
    - drupal-composer/drupal-scaffold 2.6.1 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - oomphinc/composer-installers-extender is locked to version v1.1.2 and an update of this package was not requested.    - oomphinc/composer-installers-extender v1.1.2 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 3
    - drupal-composer/drupal-scaffold 2.6.1 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - goalgorilla/open_social 9.4.0 requires drupal-composer/drupal-scaffold ^2.5.0 -> satisfiable by drupal-composer/drupal-scaffold[2.6.1].
    - goalgorilla/open_social is locked to version 9.4.0 and an update of this package was not requested.

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.

In reading though several bug reports and various different posts I see this isn't a uncommon problem to have due to the last update of composer from V1 to V2.

It was recommended in a bug report that the submitter downgrade Composer to V1 so I did that and got a different set of results as follows.

    PS C:\> composer self-update 1.4.1
Upgrading to version 1.4.1 (stable channel).

Unable to write "C:\ProgramData\ComposerSetup\bin\composer.phar". Access is denied.
Complete this operation with Administrator privileges [Y,n]? y
Operation succeeded.
Use composer self-update --rollback to return to version 2.0.7
PS C:\> composer create-project goalgorilla/social_template:dev-master DIR --no-interaction
Warning from https://packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2
Installing goalgorilla/social_template (dev-master dd01e6827fb19f29b3245fa893ac1f5911c72200)
  - Installing goalgorilla/social_template (dev-master master): Cloning master from cache
Created project in DIR
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file


  [ErrorException]
  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"

The only thing I can find on that was on stack which basically said, yeah no way that's going to work.

Its my understanding that the next release will address the Composer2 changes required but is anyone aware of detailed documentation that would help me presently in navigating the scaffold issues? I am seeing all sorts of posts about patches and work arounds where what is being described is way way over my head.

I am way out of my league here in working this out but stubborn enough to learn with the right glints of information.

1
  • 2
    Not really Drupal related, this is more Composer upgrade in general, but you have to upgrade those packages first with Composer 1 and hope they have plug-in v 2 compatibility before Composer 2 will work with them. – Kevin Nov 21 '20 at 20:26
1

I can see in your output that you are trying to update to a specific version of Composer and it also prompting an "Access Denied" shortly after:

PS C:\> composer self-update 1.4.1
Upgrading to version 1.4.1 (stable channel).

Unable to write "C:\ProgramData\ComposerSetup\bin\composer.phar". Access is denied.

So it looks like that command already failed. You may have to manually install Composer on your machine if you run in such permission errors and move the composer.phar executable to the appropriate directory.

PHP 7.3

Please also see this GitHub issue for the ErrorException that you are facing: PHP 7.3 breaks composer with continue/targeting error (solution: downgrade to 7.2) #7783

[ErrorException]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

In that issue it states that you will need at least Composer version v1.6.0 or up to be compatible with PHP 7.3.

Composer v1

Is there any reason why you need an old v1.4.1 version? If not then for now I suggest you rollback to the latest stable version of Composer v1 as per @Kevin's comment, which you can do by running:

composer self-update --1

Which should currently give you Composer v1.10.17, or again if that fails download the latest v1 manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.