Roots Discourse

ACF Pro - Install with bedrock unable to install

Hi,

I have a question I have followed the documentation on the roots.io website on how to install ACF Pro using a private key and version. I have copy-pasted and made changes to the code but without luck. I am unable to install ACF Pro keep getting the same error "Your requirements could not be resolved to an installable set of packages."

Can someone help me out?

my composer.json:

{
  "name": "wp-starter-nm/theme",
  "type": "project",
  "description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
  "keywords": [
    "bedrock",
    "composer",
    "roots",
    "wordpress",
    "wp",
    "wp-config"
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org",
      "only": [
        "wpackagist-plugin/*",
        "wpackagist-theme/*"
      ]
    },
    {
      "type": "package",
      "package": {
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.9.3",
        "type": "wordpress-muplugin",
        "dist": {
          "type": "zip",
          "url": "https://connect.advancedcustomfields.com/index.php?a=download&p=pro&k={%ACF_PRO_KEY}&t={%version}"
        },
        "require": {
          "philippbaschke/acf-pro-installer": "^1.0.2",
          "composer/installers": "^1.0"
        }
      }
    }
  ],
  "require": {
    "php": ">=7.1",
    "composer/installers": "^1.8",
    "vlucas/phpdotenv": "^4.1.8",
    "oscarotero/env": "^2.1",
    "roots/bedrock-autoloader": "^1.0",
    "roots/wordpress": "5.5.1",
    "roots/wp-config": "1.0.0",
    "roots/wp-password-bcrypt": "1.0.0",
    "advanced-custom-fields/advanced-custom-fields-pro": "5.*.*",
    "wpackagist-plugin/contact-form-7": "*",
    "wpackagist-plugin/a3-lazy-load": "*",
    "wpackagist-plugin/wp-optimize": "*",
    "wpackagist-plugin/wp-cerber": "*",
    "wpackagist-plugin/advanced-access-manager": "*",
    "wpackagist-plugin/wordpress-seo": "*",
    "wpackagist-plugin/regenerate-thumbnails": "*"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^3.5.6",
    "roave/security-advisories": "dev-master"
  },
  "config": {
    "optimize-autoloader": true,
    "preferred-install": "dist"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "extra": {
    "installer-paths": {
      "web/app/mu-plugins/{$name}/": [
        "type:wordpress-muplugin",
        "wpackagist-plugin/wp-cerber",
        "wpackagist-plugin/advanced-access-manager",
        "wpackagist-plugin/wordpress-seo",
        "wpackagist-plugin/regenerate-thumbnails",
        "wpackagist-plugin/contact-form-7",
        "wpackagist-plugin/a3-lazy-load",
        "wpackagist-plugin/wp-optimize"
      ],
      "web/app/plugins/{$name}/": [
        "type:wordpress-plugin"
      ],
      "web/app/themes/{$name}/": [
        "type:wordpress-theme"
      ]
    },
    "wordpress-install-dir": "web/wp"
  },
  "scripts": {
    "post-root-package-install": [
      "php -r \"copy('.env.example', '.env');\""
    ],
    "test": [
      "phpcs"
    ]
  }
}

Error:

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

  Problem 1
    - The requested package advanced-custom-fields/advanced-custom-fields-pro 5. exists as advanced-custom-fields/advanced-custom-fields-pro[5.9.3] but these are rejected by your constraint.

MacBook-Pro-van-Nino:wordpress-starter-nm nino$ 
MacBook-Pro-van-Nino:wordpress-starter-nm nino$ composer update
Loading composer repositories with package information
Warning from https://repo.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
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - advanced-custom-fields/advanced-custom-fields-pro 5.9.3 requires philippbaschke/acf-pro-installer ^1.0.2 -> satisfiable by philippbaschke/acf-pro-installer[v1.0.2].
    - Installation request for advanced-custom-fields/advanced-custom-fields-pro 5.*.* -> satisfiable by advanced-custom-fields/advanced-custom-fields-pro[5.9.3].
    - Conclusion: remove vlucas/phpdotenv v4.1.8
    - Conclusion: don't install vlucas/phpdotenv v4.1.8
    - philippbaschke/acf-pro-installer v1.0.2 requires vlucas/phpdotenv ^2.2 -> satisfiable by vlucas/phpdotenv[2.2.x-dev, 2.3.x-dev, 2.4.x-dev, 2.5.x-dev, 2.6.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 2.2.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 2.3.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 2.4.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 2.5.x-dev].
    - Can only install one of: vlucas/phpdotenv[4.1.x-dev, 2.6.x-dev].
    - Installation request for vlucas/phpdotenv ^4.1.8 -> satisfiable by vlucas/phpdotenv[4.1.x-dev, v4.1.8].

Thanks in advance :slight_smile:

Are you using composer v2? Have you updated your Bedrock site, especially the composer files?

Very weird for some reason when i use the following:

"require": {
          "ffraenz/private-composer-installer": "^5.0"
 }

It works I am still using V1.0.

Thanks anyways.

The issue is that fraenz/private-composer-installer project/package isn’t updated anymore,
hence it requires a much older vlucas/phpdotenv package as the Bedrock site itself does.
There is a new project/package that is maintained and requires a compatible vlucas/phpdotenv release, see this issue:

Drop-in replacement that is compatible with recent Bedrock sites:

See this guide:

1 Like