{"record":{"id":"6b3774c5b1c8f7a4","repo":"octobercms/october","slug":"package-name-not-found-6b3774","errorCode":null,"errorMessage":"Package [$name] not found","messagePattern":"Package \\[\\$name\\] not found","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/system/classes/updatemanager/ManagesThemes.php","lineNumber":27,"sourceCode":"use October\\Rain\\Filesystem\\Zip;\nuse ApplicationException;\n\n/**\n * ManagesThemes\n *\n * @package october\\system\n * @author Alexey Bobkov, Samuel Georges\n */\ntrait ManagesThemes\n{\n    /**\n     * installTheme using composer\n     */\n    public function installTheme($name)\n    {\n        [$package, $version] = $this->findThemeComposerCode($name);\n        if (!$package) {\n            throw new ApplicationException(\"Package [$name] not found\");\n        }\n\n        $composer = ComposerManager::instance();\n        $composer->require([$package => $this->getComposerVersionConstraint($version)]);\n\n        // Lock theme\n        $themeFolder = strtolower(str_replace('.', '-', System::composerToOctoberCode($package)));\n        $this->themeManager->createChildTheme($themeFolder);\n        $this->themeManager->performLockOnTheme($themeFolder);\n    }\n\n    /**\n     * findThemeComposerCode locates a composer code for a plugin\n     */\n    protected function findThemeComposerCode(string $code): array\n    {\n        // Local\n        if ($this->themeManager->findByIdentifier($code)) {","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/classes/updatemanager/ManagesThemes.php#L9-L45","documentation":"Thrown by UpdateManager::installTheme() when a theme cannot be resolved to a composer package. findThemeComposerCode() first checks locally (themeManager->findByIdentifier + getComposerCode + getLatestVersion) and then falls back to the update server (requestThemeDetails -> requestServerData('package/detail')). If neither path yields a composer_code, installTheme aborts with 'Package [$name] not found' before composer require ever runs.","triggerScenarios":"Calling UpdateManager::instance()->installTheme('Author.Theme') where the theme is neither installed locally with a recorded composer code nor returned by the marketplace gateway (details['composer_code'] empty); typo in the theme code; theme removed from the marketplace; gateway unreachable so the remote lookup returns nothing usable.","commonSituations":"Installing a theme by a code copied from an outdated marketplace URL; private/custom themes never published to the October marketplace; a corporate firewall blocking the update gateway so the details payload comes back empty.","solutions":["Verify the exact theme code (Author.Name) on the theme's octobercms.com marketplace page and retry with that code","Check the response of UpdateManager::instance()->requestThemeDetails($name) and confirm the composer_code key is present and non-empty","For private themes, bypass installTheme: add your own composer repository, run composer require vendor/package, then lock the theme from the backend","If the gateway request itself fails, fix network/DNS access to the update server, clear cached update metadata, and retry"],"exampleFix":"// before\nUpdateManager::instance()->installTheme($name);\n\n// after\n$details = UpdateManager::instance()->requestThemeDetails($name);\nif (empty($details['composer_code'])) {\n    throw new RuntimeException(\"Theme [{$name}] is not resolvable to a composer package; install it via composer manually.\");\n}\nUpdateManager::instance()->installTheme($name);","handlingStrategy":"validation","validationCode":"$details = \\UpdateManager::instance()->requestThemeDetails($themeName);\nif (empty($details['composer_code'])) {\n    // do not call installTheme; surface an actionable message or install via composer directly\n}","typeGuard":null,"tryCatchPattern":"try { \\UpdateManager::instance()->installTheme($name); } catch (\\ApplicationException $ex) { /* show $ex->getMessage() to the user; log for support */ }","preventionTips":["Always copy theme codes verbatim from the marketplace product page","For private themes, use composer require from your own repository instead of installTheme","Log the requestThemeDetails response when building install tooling so empty composer_code is visible"],"tags":["theme","composer","marketplace","install"],"backgroundTag":"package-not-found","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}