Acorn is not a registered wp command

Trying to run a Sage 10.0.0-beta.1: TBA theme in a fresh Trellis/Bedrock install.

I upgraded acorn to 3.2. If I try to run a wp acorn command I get this error (The theme is active):

$ wp acorn optimize:clear
Error: 'acorn' is not a registered wp command. See 'wp help' for available commands.
Did you mean 'core'?

I tried to install Acorn in Bedrock instead in Sage but I get an aditional error:

$ wp acorn optimize:clear
Warning: include(/srv/www/contraindicaciones.net/current/web/app/themes/ci/vendor/composer/../roots/acorn/src/Roots/Acorn/Bootloader.php): Failed to open stream: No such file or directory in phar:///usr/bin/wp/vendor/composer/ClassLoader.php on line 571
Warning: include(): Failed opening '/srv/www/contraindicaciones.net/current/web/app/themes/ci/vendor/composer/../roots/acorn/src/Roots/Acorn/Bootloader.php' for inclusion (include_path='.:/usr/share/php') in phar:///usr/bin/wp/vendor/composer/ClassLoader.php on line 571

Sage v10 beta’s aren’t compatible with Acorn v3 without making changes to the theme

Beta 1 shipped with Acorn v2.0.0-alpha.0. I’d suggest giving that a shot first by installing it from the theme dir.

1 Like

I already installed the latest release of sage and acorn, but the issue still persisting; not sure what is missing, any hint is appreciated:

here is my composer:

{
  "name": "roots/bedrock",
  "type": "project",
  "license": "MIT",
  "description": "WordPress boilerplate with Composer, easier configuration, and an improved folder structure",
  "homepage": "https://roots.io/bedrock/",
  "authors": [
    {
      "name": "Scott Walkinshaw",
      "email": "scott.walkinshaw@gmail.com",
      "homepage": "https://github.com/swalkinshaw"
    },
    {
      "name": "Ben Word",
      "email": "ben@benword.com",
      "homepage": "https://github.com/retlehs"
    }
  ],
  "keywords": [
    "bedrock",
    "composer",
    "roots",
    "wordpress",
    "wp",
    "wp-config"
  ],
  "support": {
    "issues": "https://github.com/roots/bedrock/issues",
    "forum": "https://discourse.roots.io/category/bedrock"
  },
  "repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org",
      "only": [
        "wpackagist-plugin/*",
        "wpackagist-theme/*"
      ]
    }
  ],
  "require": {
    "php": ">=8.0",
    "composer/installers": "^2.2",
    "vlucas/phpdotenv": "^5.5",
    "oscarotero/env": "^2.1",
    "roots/bedrock-autoloader": "^1.0",
    "roots/bedrock-disallow-indexing": "^2.0",
    "roots/wordpress": "6.3",
    "roots/wp-config": "1.0.0",
    "roots/wp-password-bcrypt": "1.1.0",
    "roots/acorn": "^3.2",
    "spatie/laravel-ignition": "^1.6"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^3.7.1",
    "roave/security-advisories": "dev-latest"
  },
  "config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "allow-plugins": {
      "composer/installers": true,
      "roots/wordpress-core-installer": true
    }
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "extra": {
    "installer-paths": {
      "web/app/mu-plugins/{$name}/": [
        "type:wordpress-muplugin"
      ],
      "web/app/plugins/{$name}/": [
        "type:wordpress-plugin"
      ],
      "web/app/themes/{$name}/": [
        "type:wordpress-theme"
      ]
    },
    "wordpress-install-dir": "web/wp"
  },
  "scripts": {
    "test": [
      "phpcs"
    ],
    "post-autoload-dump": [
      "Roots\\Acorn\\ComposerScripts::postAutoloadDump"
    ]
  }
}

@aqeltech did you find a solution?

I have the same issue, I SSH into the vagrant box with vagrant ssh and then cd /srv/www/example.com/current to run wp commands.

I install acorn with composer require roots/acorn (output: Using version ^4.0 for roots/acorn), but when I try to run any of these commands WP-CLI | Acorn Docs | Roots I receive this Error: 'acorn' is not a registered wp command. See 'wp help' for available commands. Did you mean 'core'?

wp-cli works as expected, if I run wp --info or wp theme list i can see that they are working, I can’t understand how to make acorn work, am I missing a step?

Acorn will not be booted unless the Sage theme is activated

If you aren’t using Sage, you need to boot Acorn