Roots Discourse

ACF pro installation failed Sage 10

Im testing out Sage 10 and everything seems to work fine until I install ACF pro.
Here is the error I get

    Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for advanced-custom-fields/advanced-custom-fields-pro ^5.8.0 -> satisfiable by advanced-custom-fields/advanced-custom-fields-pro[5.8.7].
    - Conclusion: remove vlucas/phpdotenv v4.1.0
    - Conclusion: don't install vlucas/phpdotenv v4.1.0
    - advanced-custom-fields/advanced-custom-fields-pro 5.8.7 requires ffraenz/private-composer-installer ^3.0 -> satisfiable by ffraenz/private-composer-installer[v3.0.0, v3.0.1].
    - ffraenz/private-composer-installer v3.0.0 requires vlucas/phpdotenv ^3.0 -> satisfiable by vlucas/phpdotenv[3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, 3.4.x-dev, 3.5.x-dev, 3.6.x-dev].
    - ffraenz/private-composer-installer v3.0.1 requires vlucas/phpdotenv ^3.0 -> satisfiable by vlucas/phpdotenv[3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, 3.4.x-dev, 3.5.x-dev, 3.6.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 3.0.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 3.1.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 3.2.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 3.3.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 3.4.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 3.5.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 3.6.x-dev].
    - Installation request for vlucas/phpdotenv ^4.1.0 -> satisfiable by vlucas/phpdotenv[4.1.x-dev, v4.1.0].

relevant lines in my composer.json file:

{
      "type": "package",
      "package": {
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.8.7",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://connect.advancedcustomfields.com/index.php?a=download&p=pro&k={%ACF_PRO_KEY}&t={%version}"
        },
        "require": {
          "composer/installers": "^1.8",
          "ffraenz/private-composer-installer": "^3.0"
        }
      }
    }
  ],
  "require": {
    "php": ">=7.1",
    "composer/installers": "^1.8",
    "vlucas/phpdotenv": "^4.1.0",
    "oscarotero/env": "^1.2.0",
    "roots/wordpress": "5.3.2",
    "roots/wp-config": "1.0.0",
    "roots/wp-password-bcrypt": "1.0.0",
    "advanced-custom-fields/advanced-custom-fields-pro": "^5.8.0",

Any help would be appreciated.

I did see this topic, Sage 10 dev + ACF pro: Unable to resolve installation set of packages but as far as I can tell, I have the installer updated to the current version.

The error message is telling you the problem:

- advanced-custom-fields/advanced-custom-fields-pro 5.8.7 requires ffraenz/private-composer-installer ^3.0 -> satisfiable by ffraenz/private-composer-installer[v3.0.0, v3.0.1].
    - ffraenz/private-composer-installer v3.0.0 requires vlucas/phpdotenv ^3.0 -> satisfiable by vlucas/phpdotenv[3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, 3.4.x-dev, 3.5.x-dev, 3.6.x-dev].
...
- Installation request for vlucas/phpdotenv ^4.1.0 -> satisfiable by vlucas/phpdotenv[4.1.x-dev, v4.1.0].

The version of vlucas/phpdotenv required by the ACF installer conflicts in an unresolvable way with the version of vlucas/phpdotenv required explicitly in your composer.json. One of those things needs to be updated. I’d recommend forking and updating the installer, since IIRC Bedrock has some changes that expect v4 of dotenv. You might also file a PR w/ the installer maintainer to update their dependencies.

2 Likes

@alwaysblank has the answer here. ffraenz’s repo is out of date and conflicts with Bedrock (this issue is with Bedrock, not with Sage 10).

Recommendation: fork the repo, fix it, and submit a PR!

yea I realized it wasnt a sage issue after posting this

@joecamel9166 use “ffraenz/private-composer-installer” instead:

Under repositories in composer.json add:

{
      "type": "package",
      "package": {
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.8.7",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://connect.advancedcustomfields.com/index.php?a=download&p=pro&k={%ACF_PRO_KEY}&t={%VERSION}"
        },
        "require": {
          "composer/installers": "^1.4",
          "ffraenz/private-composer-installer": "^3.0"
        }
      }
    },

Add your license key to .env file:
ACF_PRO_KEY=ThisIsYourUniqueKey

Then run composer require "advanced-custom-fields/advanced-custom-fields-pro"

They’re using the ffraenz repo already. That’s the one with the incompatible version of phpdotenv. Hopefully ffraenz can fix this upstream.

1 Like

This issue has been reported upstream, and the author has promised a fix!

I’m going to close this topic. Thanks, everyone!