octobercms/october · error · Exception

A theme already exists at

Error message

A theme already exists at '{$themeFolder}' please rename this folder and try again.

What it means

Pre-install guard in the ThemeInstall console command: the target themes directory (derived from the vendor.name argument) already exists, so installing would clobber an existing theme. The existing folder named in the message is the conflict.

Solutions

  1. Rename or move the existing theme folder and re-run the command
  2. Choose a different theme name to install
  3. Delete the existing theme if it is no longer needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/cms/console/ThemeInstall.php:104 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/4708538f85e6b38b. Report an issue: GitHub.

Appendix: source

Thrown at modules/cms/console/ThemeInstall.php:104

        passthru('"'.PHP_BINARY.'" artisan plugin:check');

        $this->output->success("Theme '{$name}' installed");
    }

    /**
     * assertCanInstallTheme makes sure the theme isn't in use
     */
    protected function assertCanInstallTheme()
    {
        $name = strtolower($this->argument('name'));

        $parts = explode('.', $name);
        $themeFolder = $parts[1] ?? null;
        $themePath = themes_path($themeFolder);

        // Ensure a theme does not already exist
        if ($themeFolder && file_exists($themePath)) {
            throw new Exception("A theme already exists at '{$themeFolder}' please rename this folder and try again.");
        }
    }

    /**
     * performLockOnTheme locks the theme and creates a child theme
     */
    protected function performLockOnTheme()
    {
        $name = strtolower($this->argument('name'));

        // Legacy composer installers
        $parts = explode('.', $name);
        $themeFolder = $parts[1] ?? null;
        $themePath = $themeFolder ? themes_path($themeFolder) : null;

        // New composer installers
        if (!$themePath || !file_exists($themePath)) {
            $themeFolder = strtolower(str_replace('.', '-', $name));

View on GitHub (pinned to b608633a7e)