fix(plugins): allow npm tarball fetches for plugin installs

npm 12 changed the default of allow-remote to none. Claude installs
npm plugin sources such as rea-agents from a registry tarball URL, so
`claude plugin install rea@rea` failed with EALLOWREMOTE. The client
commands now run with npm_config_allow_remote=all. root does not
cover this case. The setting applies only to these child processes,
and a value the user sets still takes precedence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
fraujulianandClaude Opus 5.5 committed 2026-11-23 09:05:24 +01:00
1 parent 2b2403e1de
commit 3725fe31ee
1 file changed
+3
+3
View File
@@ -83,6 +83,9 @@ def run_command(arguments, summary=False, home=None):
if executable is None:
raise ValueError(f'{arguments[0]} CLI is required to manage plugins.')
environment = os.environ.copy()
# npm 12 defaults allow-remote to none, so Claude's install of an npm plugin source (a registry tarball URL) fails
# with EALLOWREMOTE. "root" is not enough there; "all" applies only to this child process, and a user value wins.
environment.setdefault('npm_config_allow_remote', 'all')
if home is not None:
environment.update(HOME=str(home), USERPROFILE=str(home), CODEX_HOME=str(home / '.codex'), CLAUDE_CONFIG_DIR=str(home / '.claude'))
result = subprocess.run([executable, *arguments[1:]], stdin=subprocess.DEVNULL,