在 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。
Cannot add marketplace "_internal": Claude Code cannot install plugins from a marketplace with this 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. The name is set by "name" in the marketplace's marketplace.json; ask its maintainer to change it.
您執行了 /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 在查詢前沒有重新整理市集,例如當您離線時,所以您的目錄副本可能已過時。使用市集的名稱重新整理,然後再次安裝:
claude plugin install 在您的 shell 中列印不同的訊息。對於已在目標範圍安裝的外掛程式,它列印 Plugin "<name>@<marketplace>" is already installed (scope: user) 並以退出代碼 0 退出。如果其快取目錄遺失,相同的命令會重新下載它。
`"" was not installed: it would share its folder with ""`
您透過 claude plugin install、/plugin 或工作階段中的安裝建議安裝了外掛程式,Claude Code 拒絕了它,並顯示此行或 would share its saved data with。
被拒絕的外掛程式的 id 和已安裝的外掛程式的 id 對應到磁碟上的相同資料夾:一旦 . 和 @ 被寫成 -,它們就是相同的。在 macOS 和 Windows 上,僅在大寫字母中不同的 id 也對應到相同的資料夾。安裝兩者會將一個外掛程式的檔案放在另一個的資料夾中,因此 Claude Code 拒絕,已安裝的外掛程式保留其檔案。
訊息命名了解決方案:
其他外掛程式已安裝:訊息說 Only one of the two can be installed. 並命名 claude plugin uninstall 命令或 /plugin 中的卸載步驟,以移除其他外掛程式。執行它,然後再次安裝。對於卸載移除的內容,請參閱 卸載刪除和保留的內容。
兩個 id 在一次安裝中到達,例如外掛程式及其需要的相依套件:沒有安裝順序可以幫助。只有列出這兩個外掛程式的市集的維護者可以修復它,方法是重新命名其中一個。當兩者來自不同的市集時,任一個的維護者都可以。
`This plugin uses a source type your Claude Code version does not support`
您安裝了一個外掛程式,其市集條目使用此版本 Claude Code 無法擷取的來源類型,Claude Code 停止並顯示此訊息和 Update Claude Code and try again.
您安裝了一個作為 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.
"github:acme/formatter" was not installed: it is not an http or https link. An npm plugin source must name a registry package (name or name@version) or link to a tarball file. For a plugin in a git repository, use a "github", "url" or "git-subdir" source.
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 儲存庫再次新增市集
市集在 ~/.claude/plugins/known_marketplaces.json 中有條目,但該條目未通過 Claude Code 每次讀取該檔案時執行的檢查,因此市集和從它安裝的外掛程式停止載入。在您的 shell 中,claude plugin list 會為每個受影響的外掛程式報告一行,指出原因和修復方式:
Marketplace team-tools is added but ignored. Its location is on a network drive, has "." or ".." in its path, or couldn't be checked. Re-add the marketplace (one added from a folder or file must be re-added from a copy on this computer), or, to trust a folder on a network drive, declare it under extraKnownMarketplaces in user or managed settings.
Its location is on a network drive, has "." or ".." in its path, or couldn't be checked,或關於 The folder or file it was added from 的相同句子:市集的目錄或其新增來源的本機路徑位於網路位置、路徑中有 . 或 .. 區段,或無法檢查
Its git URL can't be used: <reason> 或 Its URL can't be read as an https:// or http:// address:條目記錄的來源 URL 是 Claude Code 拒絕從中複製或擷取的 URL
Its source doesn't match its extraKnownMarketplaces entry in user or managed settings:條目與同名的 extraKnownMarketplaces 宣告不符
當 (see the debug log) 取代原因出現在 is added but ignored 之後時,表示 Claude Code 拒絕了市集的名稱,例如 保留名稱的另一種拼寫。偵錯日誌 會指出該條目。
該怎麼做:
依照訊息中的修復方式。在您的 shell 中,執行 claude plugin marketplace remove <name>,然後從支援的來源或本機路徑再次新增市集,並重新安裝其外掛程式(remove 命令會卸載這些外掛程式)。remove 命令對被忽略的條目有效
在 v2.1.286 之前,無論原因為何,claude plugin list 都會將此類市集報告為 Marketplace <name> not found,而 /pluginErrors 標籤會將其報告為 Marketplace "<name>" is registered but was refused (see the debug log)。原因僅出現在偵錯日誌中。在 v2.1.286 中,原因和修復句子使用不同的措辭,例如 Its recorded location is network-shaped or unclassifiable (never probed)。
`Plugin has a corrupt manifest file` or `has an invalid manifest file`
Claude Code 擷取了外掛程式,然後無法讀取其 .claude-plugin/plugin.json。在 shell 中,此行中的 <name> 可以是臨時目錄名稱;Failed to install plugin "<name>@<marketplace>" 前綴帶有外掛程式的真實名稱。措辭說明哪個檢查失敗:
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.
在 v2.1.287 之前,訊息為 Cannot add marketplace "<name>": its network source differs from the one declared for it in settings (kind, target, or a fetch-shaping field such as headers / ref / path / sparsePaths)。
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 以啟用外掛程式,或啟動新工作階段
were not installed, because ...:此外掛程式無法執行安裝,註記會指出原因,例如 Yarn、pnpm 或 bun.lockb 鎖定檔,或其套件管理器未安裝在此電腦上的鎖定檔。只要該原因仍存在,更新外掛程式就不會安裝這些套件。如果原因是鎖定檔,則必須由外掛程式的作者替換它。如果是缺少套件管理器,請安裝它,然後更新外掛程式
`Plugin "" not cached at `
Errors 標籤顯示此行及指導 Run /plugin to refresh the plugin cache。Claude Code 有外掛程式的安裝記錄,但記錄指向的目錄遺失,例如在您清除快取後。
`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 排程上老化。
`does not load (...), so Claude Code ignores the whole file`
修正警告所指出的錯誤。對於 Claude Code 不接受的值,修正損壞的設定檔 說明了修正方法。然後,如果命令的變更已不在檔案中,請再次執行該命令。
警告會出現在您 shell 中 claude plugin install、enable、disable 或 claude plugin marketplace add 的成功行之後:
⚠ /home/user/.claude/settings.json does not load (its "permissions" is not valid), so Claude Code ignores the whole file, including anything this command wrote there. Fix the file, then run this command again if its change is missing. If a newer Claude Code wrote the file, update Claude Code instead.
括號中的文字指出錯誤:
its "<key>" is not valid:加上引號的設定項目持有 Claude Code 不接受的值。請在 設定參考 中查閱該設定項目可接受的值。當有多個值無效時,文字會指出第一個設定項目並計算其他項目的數量,例如 its "permissions" and 1 other value are not valid。
it is not a JSON object:檔案的頂層不是 JSON 物件,例如頂層是陣列的檔案。
`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 之前,錯誤沒有命名外掛程式。
即使訊息要求重新安裝,也請先在 Claude Code 提示字元執行 /reload-plugins。當您的工作階段載入外掛程式 hook 的目錄已從磁碟上消失時,外掛程式的 hook 會失敗並顯示 Failed to run: Plugin directory does not exist: <path> (<plugin> — run /plugin to reinstall),且該 hook 不會執行。Plugin directory not found at path: <path> 是另一則訊息,與市集條目有關。
若要讀取伺服器在啟動時列印的錯誤,請執行 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。
VS Code 擴充功能的管理外掛程式對話框:在安裝後以表單形式要求未設定的選項。在 v2.1.285 之前,在該處安裝不會顯示選項表單,因此請使用 /plugin configure <plugin>@<marketplace> 從終端機工作階段設定值
在您的 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
如果您傳遞資訊清單未宣告的 --config 鍵,外掛程式仍會安裝,命令會列印 ⚠ Installed, but --config not applied: --config key "<key>" isn't declared in this plugin's userConfig. 後面跟著外掛程式確實宣告的鍵。
對於運送MCPB 套件檔案的外掛程式,該檔案宣告其自身的 user_config,訊息改為讀取 isn't declared in this plugin's userConfig or by its bundled MCP servers.,已知的鍵包括該伺服器的鍵,寫成 <server>.<key>。資訊清單按 URL 參考的套件在安裝時不會被讀取,因此其鍵不會被列出,訊息會說在 /plugin 中設定它。設定 <server>.<key> 鍵需要 Claude Code v2.1.285 或更新版本。
`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.
249Cannot add marketplace "_internal": Claude Code cannot install plugins from a marketplace with this 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. The name is set by "name" in the marketplace's marketplace.json; ask its maintainer to change it.
819⚠ /home/user/.claude/settings.json does not load (its "permissions" is not valid), so Claude Code ignores the whole file, including anything this command wrote there. Fix the file, then run this command again if its change is missing. If a newer Claude Code wrote the file, update Claude Code instead.
820```
821
822括號中的文字指出錯誤:
823
824* **`its "<key>" is not valid`**:加上引號的設定項目持有 Claude Code 不接受的值。請在 [設定參考](/docs/zh-TW/settings-reference) 中查閱該設定項目可接受的值。當有多個值無效時,文字會指出第一個設定項目並計算其他項目的數量,例如 `its "permissions" and 1 other value are not valid`。
825* **`it is not a JSON object`**:檔案的頂層不是 JSON 物件,例如頂層是陣列的檔案。
934即使訊息要求重新安裝,也請先在 Claude Code 提示字元執行 `/reload-plugins`。當您的工作階段載入外掛程式 hook 的目錄已從磁碟上消失時,外掛程式的 hook 會失敗並顯示 `Failed to run: Plugin directory does not exist: <path> (<plugin> — run /plugin to reinstall)`,且該 hook 不會執行。[`Plugin directory not found at path: <path>`](#plugin-directory-not-found-at-path) 是另一則訊息,與市集條目有關。
873 `Invalid MCP server config for "<server>"` and MCP servers that don't start943 `Invalid MCP server config for "<server>"` and MCP servers that don't start