在 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 以啟用外掛程式,或啟動新工作階段
`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 上。
`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 標籤中不會出現任何內容。
`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.
83 `claude: command not found` after `claude plugin ...`
84</h3>
85
86您在 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`。
87
88原因不是外掛程式命令。要麼 Claude Code 未安裝,要麼其安裝目錄不在此 shell 中的 `PATH` 上。遵循 [`command not found: claude` after installation](/docs/zh-TW/troubleshoot-install#command-not-found-claude-after-installation),然後重試外掛程式命令。
209Claude Code 接受包含 `.claude-plugin/marketplace.json` 的目錄,或指向 `.json` 檔案的路徑。指向任何其他檔案的路徑會失敗,並顯示 `File path must point to a .json file (marketplace.json)`。
258 `Command 'git' not found or is in an unsafe location`
259</h3>
260
261在 Windows 上,您新增了市集,Claude Code 報告 `Failed to clone marketplace repository: Command 'git' not found or is in an unsafe location (current directory)`。
363 `not found in marketplace` with a refresh hint
364</h4>
365
366提示讀取 `Your local copy may be out of date — try claude plugin marketplace update <marketplace>` 或 `The marketplace couldn't be refreshed (...)`。Claude Code 在查詢前沒有重新整理市集,例如當您離線時,所以您的目錄副本可能已過時。使用市集的名稱重新整理,然後再次安裝:
367
368```text theme={null}
369/plugin marketplace update <marketplace>
370```
371
372`claude plugin marketplace update` 列印 `Successfully updated marketplace: <name>`,而 `/plugin marketplace update` 顯示 `✔ Updated 1 marketplace`。如果重試的安裝列印相同的訊息,請按照 [`not found in marketplace` with no hint](#the-message-has-no-hint) 描述檢查名稱。[Claude Code 何時在安裝前重新整理市集](/docs/zh-TW/plugins/loading#when-claude-code-refreshes-a-marketplace-before-an-install) 列出重新整理不執行的其他情況。
383 `Plugin "<name>" not found in any marketplace`
384</h3>
385
386您執行了 `/plugin install <name>`,沒有 `@marketplace`,沒有註冊的市集有該外掛程式。`claude plugin install <name>` 報告 `Plugin "<name>" not found in any configured marketplace`。
422您安裝了一個作為 zip 存檔分發的外掛程式,Claude Code 拒絕了它,並顯示此行和 `The archive was not installed.`。外掛程式的市集條目使用帶有 `sha256` 釘選的 [`archive` 來源](/docs/zh-TW/plugins/marketplace-reference),下載的檔案的摘要與釘選不符。
423
424完整訊息如下所示:
425
426```text theme={null}
427Plugin 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.
446Marketplace "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.
503Marketplace "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.
542Could 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.
543```
544
545訊息說明了安裝前的副本發生了什麼,這告訴您外掛程式是否仍然有效:
546
547* `The previously installed copy was moved back`:您擁有的版本仍然安裝
548* `had to be removed first`、`was not moved back` 或 `could not be moved back`:該外掛程式版本在安裝成功前未安裝
549* 沒有這樣的句子:沒有較早的副本,因此版本未安裝
550
551在 Windows 上,當另一個程式持有已安裝的副本本身時,訊息改為說該副本 `could not be replaced`,並且 `It was not replaced and the new copy was discarded`,因此您擁有的版本仍然安裝。
552
553`Left on disk` 清單命名快取內的預留資料夾。稍後安裝該版本或外掛程式快取清理會移除它們,因此您不需要刪除它們。
554
555若要修復安裝:
556
557* 關閉使用外掛程式資料夾(在 `~/.claude/plugins/cache` 下)的其他 Claude Code 工作階段、編輯器和終端機,然後再次執行安裝
576| `<Plugin or Dependency> "<name>" has conflicting version requirements` | 沒有版本滿足每個釘選它的範圍。訊息列出範圍。 | 卸載或更新其中一個衝突的外掛程式,或要求上游作者擴大其約束。 |
577| `... has version requirements too complex to intersect` 或 `has an invalid version requirement` | 範圍不是有效的 semver,或無法相交組合的範圍。 | 修復無效範圍或簡化長 `\|\|` 鏈。 |
578| `... has no git tag satisfying <range>` | 依賴項的儲存庫在範圍內沒有 `<name>--v*` 標籤。 | 檢查上游是否使用該約定標記版本,或放寬範圍。 |
579| `Dependency "<dep>" (required by <plugin>) is in <marketplace>, which is not in the allowlist` | 依賴項在不同的市集中,預設情況下跨市集解析已關閉。 | 在相同範圍自行安裝依賴項,在您的 shell 中使用 `claude plugin install <dep>@<marketplace>` 加上您安裝外掛程式的 `--scope`,然後重試。 |
607 如果外掛程式已安裝且無錯誤,但您在此工作階段期間安裝了它,請執行 `/reload-plugins`。它列印 `Reloaded:` 及外掛程式、技能、代理、hooks 和伺服器的計數。當某些失敗時,它新增 `N errors during load. Run /plugin for details.`
628* **`Reloaded:` 及外掛程式、技能、代理、hooks 和伺服器的計數**:外掛程式現在處於活動狀態。當某些無法載入時,該行新增 `N errors during load. Run /plugin for details.`
629* **`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` 以啟用外掛程式,或啟動新工作階段
660 `Plugin "<name>" is enabled in project settings but isn't installed here`
661</h3>
662
663**Errors** 標籤顯示此行用於您的專案的 `.claude/settings.json` 啟用的外掛程式,指導 `Run claude plugin install <name>@<marketplace> --scope project to install it for this project`。
772`/plugin` **Errors** 標籤顯示失敗及其原因,例如 `Executable not found in $PATH: "<binary>"`,而 `claude --debug` 將其記錄為 `LSP server <name> failed to start: <reason>`。
803**Errors** 標籤顯示 `commands path not found: <absolute path>`,並提供指導 `Check that the path in your manifest or marketplace config is correct`。`skills`、`agents` 和 `hooks` 也會出現相同訊息。
895如果您傳遞資訊清單未宣告的 `--config` 鍵,外掛程式仍會安裝,命令會列印 `⚠ Installed, but --config not applied: --config key "<key>" isn't declared in this plugin's userConfig.` 後面跟著外掛程式確實宣告的鍵。
931 `Warning: No commands found in plugin <name> custom directory`
932</h3>
933
934當外掛程式載入時,`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** 標籤中不會出現任何內容。
976| `Plugin name "<name>" is not kebab-case` 在 `plugins[N] plugin.json → name` 下 | 警告 | 重新命名為小寫字母、數字和連字號。Claude Code 接受其他形式,但 claude.ai 市集同步拒絕它們。 |
977| `Entry declares version "<a>" but <path>/plugin.json says "<b>"` | 警告 | 更新條目以符合 `plugin.json`,在安裝時是權威的。 |
978| `Marketplace name "<name>" is reserved in Claude Desktop` | 警告 | 重新命名市集。Claude Desktop 的受管市集同步拒絕任何大小寫的 `org`、`org-provisioned` 和 `unknown`。 |
979| `Marketplace name "<name>" is not accepted by Claude Desktop` 或 `Plugin name "<name>" is not accepted by Claude Desktop` | 警告 | 重新命名為最多 128 個字元的字母、數字、`.`、`_` 和 `-`,以字母或數字開頭。 |
980
981在 v2.1.247 之前,包含控制或雙向格式化字元的市集名稱報告為 `Marketplace name impersonates an official Anthropic/Claude marketplace`。
1006 `Marketplace "<name>" is not in the allowed marketplace list`
1007</h3>
1008
1009**Errors** 標籤顯示此行,或 `Marketplace "<name>" is blocked by enterprise policy`,用於您已註冊的市集。
1010
1011相同的受管設定,阻止 [市集來源](#marketplace-source-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`。
1014 `Plugin "<name>" is blocked by your organization's policy and cannot be installed`
1015</h3>
1016
1017安裝被拒絕,並顯示此行,啟用時顯示相同的行,以 `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`。
1022 `--plugin-dir is disabled by your organization's managed settings (disableSideloadFlags)`
1023</h3>
1024
1025您使用 `--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.`