在 PowerShell 中執行 claude plugin install <plugin>@<marketplace>,而不啟動工作階段
`claude: command not found` after `claude plugin ...`
您在 shell 中執行了 claude plugin install ...,shell 根本找不到 claude。在 Windows 上,訊息是 'claude' is not recognized as the name of a cmdlet 或 'claude' is not recognized as an internal or external command。
您執行了 /plugin install <name>@<marketplace> 或 claude plugin install <name>@<marketplace>,外掛程式名稱不在您機器上該市集目錄的副本中。
當您根本沒有新增市集時,claude plugin install 在您的 shell 中列印相同的訊息。如果 claude plugin marketplace update <marketplace> 然後回答 Marketplace '<marketplace>' not found,首先新增市集。
`not found in marketplace` with a refresh hint
提示讀取 Your local copy may be out of date — try claude plugin marketplace update <marketplace> 或 The marketplace couldn't be refreshed (...)。Claude Code 在查詢前沒有重新整理市集,例如當您離線時,所以您的目錄副本可能已過時。使用市集的名稱重新整理,然後再次安裝:
您安裝了一個作為 zip 存檔分發的外掛程式,Claude Code 拒絕了它,並顯示此行和 The archive was not installed.。外掛程式的市集條目使用帶有 sha256 釘選的 archive 來源,下載的檔案的摘要與釘選不符。
完整訊息如下所示:
Plugin archive integrity check failed for https://artifacts.example.com/claude-plugins/my-plugin.zip: expected sha256 6bfa50e3d2e00c052b46abe51fff89346ac803e45771f76dcf6df1ab74cca5e1, got ac52220c0914ef8ca6a602e4a7362f88d30fb021110f72a6d15b68c3fe7df2b7. The archive was not installed. Verify the sha256 in the marketplace entry, or that the URL serves the intended file.
Marketplace "claude-community" is registered from an untrusted source: The name 'claude-community' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/anthropics/' can use this name. To fix it, remove the marketplace and re-add it from the official source.
修復因使用者和發佈者而異:
您使用市集:在您的 shell 中,執行 claude plugin marketplace remove <name>,然後從官方 github.com/anthropics 儲存庫再次新增市集
Marketplace "acme-tools" is already added from a different source (github:acme/plugins). To use this source instead, remove that marketplace first with /plugin marketplace remove acme-tools.
Could not move the new copy of this plugin version into /home/user/.claude/plugins/cache/acme-tools/formatter/1.2.0: the new copy or the version folder stayed busy while the install ran (ENOTEMPTY) — usually a scanner still reading the freshly downloaded files, another program using that folder, or another process re-creating it. The previously installed copy was moved back. Run the install again once other Claude Code sessions or programs using that folder have finished.
訊息說明了安裝前的副本發生了什麼,這告訴您外掛程式是否仍然有效:
The previously installed copy was moved back:您擁有的版本仍然安裝
had to be removed first、was not moved back 或 could not be moved back:該外掛程式版本在安裝成功前未安裝
沒有這樣的句子:沒有較早的副本,因此版本未安裝
在 Windows 上,當另一個程式持有已安裝的副本本身時,訊息改為說該副本 could not be replaced,並且 It was not replaced and the new copy was discarded,因此您擁有的版本仍然安裝。
Left on disk 清單命名快取內的預留資料夾。稍後安裝該版本或外掛程式快取清理會移除它們,因此您不需要刪除它們。
若要修復安裝:
關閉使用外掛程式資料夾(在 ~/.claude/plugins/cache 下)的其他 Claude Code 工作階段、編輯器和終端機,然後再次執行安裝
Reloaded: 及外掛程式、技能、代理、hooks 和伺服器的計數:外掛程式現在處於活動狀態。當某些無法載入時,該行新增 N errors during load. Run /plugin for details.
This reload changes MCP tools (...) — your next message will re-read the whole conversation instead of using the cache. Run /reload-plugins --force to apply.:重新載入會新增或移除外掛程式 MCP 伺服器,或 LSP 工具,並使您的提示快取失效。對於 LSP 情況,該行以 This reload adds the LSP tool 或 This reload removes the LSP tool 開頭。執行它時使用 --force 以啟用外掛程式,或啟動新工作階段
`installed_plugins.json holds a record under "" that this version of Claude Code cannot read`
訊息以這些形式出現:
claude plugin list:將其列印為 Note:
claude plugin install、uninstall 和 update:拒絕並顯示 Plugin "<name>" was not installed:、Plugin "<name>" was not uninstalled: 或 Plugin "<name>" was not updated:,後跟相同的文字
`install records under names that no version of Claude Code can use were removed from installed_plugins.json`
claude plugin list 列印此注意事項,其路徑為副本,名為 installed_plugins.set-aside.<date>.<hash>.json,只要該副本位於 installed_plugins.json 旁邊。注意事項以 Nothing needs doing about these copies. 結尾。
installed_plugins.json 中的記錄位於不是有效外掛程式 id 的金鑰下,因此沒有版本的 Claude Code 可以使用它。檔案的其餘部分正常載入。
Claude Code 將無法使用的記錄複製到 .set-aside 檔案中,並將其從清單中刪除。Claude Code 永遠不會讀取副本,副本在 cleanupPeriodDays 排程上老化。
`Disabled in ~/.claude/settings.json but still loads`
您在 ~/.claude/settings.json 中將外掛程式設定為 false,其在 claude plugin list 或 /plugin 中的行顯示此訊息,後跟啟用它的來源,例如 — project settings enable it, which overrides your user setting。該更高優先順序來源中的 true 正在覆蓋您的使用者設定。
若要在您的機器上選擇退出專案啟用的外掛程式,請在 .claude/settings.local.json 中將 id 設定為 false,其優先順序高於專案檔案。對於訊息可以命名的其他來源,請參閱 在使用者設定中停用但仍然載入。
如果 claude plugin list 改為將外掛程式標記為 required by your org,沒有設定檔涉及:您的組織在 claude.ai 上將該同步外掛程式標記為必需,即使您之前停用了它,它也會載入。請參閱 從 claude.ai 同步的外掛程式。
`Plugin "" is enabled in project settings but isn't installed here`
Errors 標籤顯示此行用於您的專案的 .claude/settings.json 啟用的外掛程式,指導 Run claude plugin install <name>@<marketplace> --scope project to install it for this project。
Failed to load hooks from <path>: <reason>:hooks/hooks.json 不是有效的 JSON 或失敗 hooks 架構。原因命名解析或驗證錯誤。修復檔案。若要在發佈外掛程式前在 hooks/hooks.json 中捕捉 JSON 語法問題,請在您的 shell 中執行 claude plugin validate <plugin-directory>
hooks path not found: <path>:清單的 hooks 欄位命名在相對於外掛程式根目錄的該路徑處不存在的檔案。修復路徑或新增檔案
`hook error` notices in the transcript
形式為 ... hook error: Failed with non-blocking status code: <stderr> 的通知表示 hook 執行且其命令失敗。例如,Stop hook error: Failed with non-blocking status code: /bin/sh: node: command not found 表示 Claude Code 產生的 shell 找不到 node。安裝它,或確保它在您啟動 claude 的終端機的 PATH 上。
退出代碼為 2 的 hook 阻止它執行的動作。當外掛程式的 hook 以這種方式阻止且其 stderr 是阻止訊息時,錯誤以 This hook comes from the <plugin> plugin. 結尾,以便您知道要停用或修復哪個外掛程式。在 v2.1.281 之前,錯誤沒有命名外掛程式。
`Invalid MCP server config for ""` and MCP servers that don't start
外掛程式捆綁了 MCP 伺服器,Errors 標籤顯示 Invalid MCP server config for "<server>": <error>,或伺服器已列出但 /mcp 永遠不會顯示它已連接。
`Invalid MCP server config for "": `
伺服器的配置通過架構檢查,但 Claude Code 無法為此工作階段解決它。冒號後的文字命名原因並決定修復:
Missing environment variables: <names>:在啟動 Claude Code 的 shell 中設定這些變數,然後啟動新工作階段
URL is unset or invalid:URL 使用的 ${user_config.*} 選項未設定。執行 /plugin configure <plugin> 以設定它
has an invalid MCP url 或 headersHelper for MCP server '<server>' references ${user_config.*}:外掛程式自己的配置有問題。修復您外掛程式的 MCP 配置中的 url 或 headersHelper,或如果外掛程式不是您的,向外掛程式的作者報告。headersHelper 情況在 外掛程式命令參考 user_config 下有自己的條目
Server is configured but never connects
執行 /mcp 以查看伺服器的狀態。當伺服器健康時,/mcp 將其列為已連接。
若要讀取伺服器在啟動時列印的錯誤,請執行 claude --debug 並在 ~/.claude/debug/<session-id>.txt 開啟日誌。--debug 旗標不會列印到終端機。
.mcp.json 中失敗架構的伺服器條目不會出現在 Errors 標籤中。Claude Code 丟棄該伺服器,並僅在該偵錯日誌中記錄 Invalid MCP server config for <server> in <path>。若要在不載入外掛程式的情況下找到條目,請在外掛程式目錄上在您的 shell 中執行 claude plugin validate,它將其報告為錯誤。
Errors 標籤顯示 commands path not found: <absolute path>,並提供指導 Check that the path in your manifest or marketplace config is correct。skills、agents 和 hooks 也會出現相同訊息。
Claude Code 從您的 plugin.json 或市集項目解析了一個路徑,相對於外掛程式根目錄,但在該處找不到任何內容。訊息中的路徑是它檢查的絕對路徑,因此請將其與磁碟上的內容進行比較。修正路徑或建立目錄,然後執行 /reload-plugins。
在您的 shell 中的 claude plugin install:永遠不會提示 userConfig 值。它會儲存您傳遞的任何 --config KEY=VALUE 值,當選項保持未設定時,它會列印 N userConfig options not yet set — run /plugin configure <plugin>@<marketplace> in Claude Code, or pass --config KEY=VALUE. 當任何未設定的選項是必需的時,(M required) 跟隨 not yet set。
如果您從 shell 安裝,請使用 --config 傳遞值,每個選項一個旗標:
claude plugin install my-plugin@my-marketplace--config api_url=https://example.com
當每個選項都設定時,安裝輸出不會包含 not yet set 行。若要之後改為開啟對話框,請在工作階段中執行 /plugin configure my-plugin@my-marketplace。
如果您傳遞資訊清單未宣告的 --config 鍵,外掛程式仍會安裝,命令會列印 ⚠ Installed, but --config not applied: --config key "<key>" isn't declared in this plugin's userConfig. 後面跟著外掛程式確實宣告的鍵。
`claude plugin validate` 報告錯誤
您執行了 claude plugin validate <path>,或在工作階段中執行了 /plugin validate <path>,它列印了 Found N errors 和 Validation failed,然後以代碼 1 結束。
`Warning: No commands found in plugin custom directory`
當外掛程式載入時,claude --debug 日誌在 ~/.claude/debug/<session-id>.txt 記錄 Warning: No commands found in plugin <name> custom directory: <path>. Expected .md files or SKILL.md in subdirectories. 工作階段或 Errors 標籤中不會出現任何內容。
Duplicate plugin name "<name>" found in marketplace
錯誤
為每個外掛程式提供唯一的 name。
Path contains "..": <path> 在 plugins[N].source 下
錯誤
使用相對於市集根目錄的路徑,沒有 .. 段。
Marketplace name cannot contain control or bidirectional-formatting characters
錯誤
從名稱中移除字元,例如逃逸或換行符。
Plugin name cannot contain control or bidirectional-formatting characters
錯誤
從外掛程式 name 中移除字元。
Claude Code cannot install plugins from marketplace "<name>". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change the marketplace's "name".
錯誤
將市集重新命名以符合訊息所述的規則。
Claude Code cannot install plugin "<name>". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change this entry's "name".
錯誤
將條目重新命名以符合訊息所述的規則。
Marketplace has no plugins defined
警告
至少新增一個條目到 plugins。
No marketplace description provided
警告
新增頂級 description。
Plugin name "<name>" is not kebab-case 在 plugins[N] plugin.json → name 下
警告
重新命名為小寫字母、數字和連字號;claude.ai 市集同步需要該形式。
Entry declares version "<a>" but <path>/plugin.json says "<b>"
警告
更新條目以符合 plugin.json,在安裝時是權威的。
Marketplace name "<name>" is reserved in Claude Desktop
`Marketplace "" is not in the allowed marketplace list`
Errors 標籤顯示此行,或 Marketplace "<name>" is blocked by enterprise policy,用於您已註冊的市集。
相同的受管設定,阻止 市集來源,在載入時適用。strictKnownMarketplaces 不包括此市集,或 blockedMarketplaces 命名它,因此 Claude Code 停止載入它及其外掛程式。對於允許清單變體,指導行顯示允許的來源,或 Contact your administrator to configure allowed marketplace sources。對於阻止清單變體,它讀取 This marketplace source is explicitly blocked by your administrator。
`Plugin "" is blocked by your organization's policy and cannot be installed`
安裝被拒絕,並顯示此行,啟用時顯示相同的行,以 cannot be enabled 結尾,或安裝或更新時顯示命名原因的行:Plugin "<name>" is from marketplace "<marketplace>", which is blocked by your organization's policy,或 Plugin "<name>" depends on "<dep>", which is blocked by your organization's policy。
`--plugin-dir is disabled by your organization's managed settings (disableSideloadFlags)`
您使用 --plugin-dir、--plugin-url、--agents 或 --mcp-config 啟動了 claude。Claude Code 以此訊息退出,並顯示 Plugins, custom agents, and MCP servers can only be loaded from sources your administrator has approved.
653 `installed_plugins.json holds a record under "<id>" that this version of Claude Code cannot read`
654</h3>
655
656訊息以這些形式出現:
657
658* **`claude plugin list`**:將其列印為 `Note:`
659* **`claude plugin install`、`uninstall` 和 `update`**:拒絕並顯示 `Plugin "<name>" was not installed:`、`Plugin "<name>" was not uninstalled:` 或 `Plugin "<name>" was not updated:`,後跟相同的文字
982| `Marketplace name cannot contain control or bidirectional-formatting characters` | 錯誤 | 從名稱中移除字元,例如逃逸或換行符。 |1027| `Marketplace name cannot contain control or bidirectional-formatting characters` | 錯誤 | 從名稱中移除字元,例如逃逸或換行符。 |
983| `Plugin name cannot contain control or bidirectional-formatting characters` | 錯誤 | 從外掛程式 `name` 中移除字元。 |1028| `Plugin name cannot contain control or bidirectional-formatting characters` | 錯誤 | 從外掛程式 `name` 中移除字元。 |
1029| `Claude Code cannot install plugins from marketplace "<name>". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change the marketplace's "name".` | 錯誤 | 將市集重新命名以符合訊息所述的規則。 |
1030| `Claude Code cannot install plugin "<name>". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change this entry's "name".` | 錯誤 | 將條目重新命名以符合訊息所述的規則。 |
984| `Marketplace has no plugins defined` | 警告 | 至少新增一個條目到 `plugins`。 |1031| `Marketplace has no plugins defined` | 警告 | 至少新增一個條目到 `plugins`。 |
986| `Plugin name "<name>" is not kebab-case` 在 `plugins[N] plugin.json → name` 下 | 警告 | 重新命名為小寫字母、數字和連字號。Claude Code 接受其他形式,但 claude.ai 市集同步拒絕它們。 |1033| `Plugin name "<name>" is not kebab-case` 在 `plugins[N] plugin.json → name` 下 | 警告 | 重新命名為小寫字母、數字和連字號;claude.ai 市集同步需要該形式。 |
987| `Entry declares version "<a>" but <path>/plugin.json says "<b>"` | 警告 | 更新條目以符合 `plugin.json`,在安裝時是權威的。 |1034| `Entry declares version "<a>" but <path>/plugin.json says "<b>"` | 警告 | 更新條目以符合 `plugin.json`,在安裝時是權威的。 |
988| `Marketplace name "<name>" is reserved in Claude Desktop` | 警告 | 重新命名市集。Claude Desktop 的受管市集同步拒絕任何大小寫的 `org`、`org-provisioned` 和 `unknown`。 |1035| `Marketplace name "<name>" is reserved in Claude Desktop` | 警告 | 重新命名市集。Claude Desktop 的受管市集同步拒絕任何大小寫的 `org`、`org-provisioned` 和 `unknown`。 |
989| `Marketplace name "<name>" is not accepted by Claude Desktop` 或 `Plugin name "<name>" is not accepted by Claude Desktop` | 警告 | 重新命名為最多 128 個字元的字母、數字、`.`、`_` 和 `-`,以字母或數字開頭。 |1036| `Marketplace name "<name>" is not accepted by Claude Desktop` 或 `Plugin name "<name>" is not accepted by Claude Desktop` | 警告 | 重新命名為最多 128 個字元的字母、數字、`.`、`_` 和 `-`,以字母或數字開頭。 |