mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-12-23 09:19:52 +00:00
refactor: remove unnecessary node installation check (#189)
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
Test / test-e2e (3.10) (push) Blocked by required conditions
Test / test-e2e (3.11) (push) Blocked by required conditions
Test / test-e2e (3.12) (push) Blocked by required conditions
Test / test-e2e (3.13) (push) Blocked by required conditions
Test / test-examples (3.10) (push) Blocked by required conditions
Test / test-examples (3.11) (push) Blocked by required conditions
Test / test-examples (3.12) (push) Blocked by required conditions
Test / test-examples (3.13) (push) Blocked by required conditions
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
Test / test-e2e (3.10) (push) Blocked by required conditions
Test / test-e2e (3.11) (push) Blocked by required conditions
Test / test-e2e (3.12) (push) Blocked by required conditions
Test / test-e2e (3.13) (push) Blocked by required conditions
Test / test-examples (3.10) (push) Blocked by required conditions
Test / test-examples (3.11) (push) Blocked by required conditions
Test / test-examples (3.12) (push) Blocked by required conditions
Test / test-examples (3.13) (push) Blocked by required conditions
Simplify CLI detection by removing redundant node installation check before throwing CLINotFoundError. 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b3656b1765
commit
d86c47f2d6
3 changed files with 2 additions and 11 deletions
|
|
@ -66,15 +66,6 @@ class SubprocessCLITransport(Transport):
|
|||
if path.exists() and path.is_file():
|
||||
return str(path)
|
||||
|
||||
node_installed = shutil.which("node") is not None
|
||||
|
||||
if not node_installed:
|
||||
error_msg = "Claude Code requires Node.js, which is not installed.\n\n"
|
||||
error_msg += "Install Node.js from: https://nodejs.org/\n"
|
||||
error_msg += "\nAfter installing Node.js, install Claude Code:\n"
|
||||
error_msg += " npm install -g @anthropic-ai/claude-code"
|
||||
raise CLINotFoundError(error_msg)
|
||||
|
||||
raise CLINotFoundError(
|
||||
"Claude Code not found. Install with:\n"
|
||||
" npm install -g @anthropic-ai/claude-code\n"
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class TestIntegration:
|
|||
async for _ in query(prompt="test"):
|
||||
pass
|
||||
|
||||
assert "Claude Code requires Node.js" in str(exc_info.value)
|
||||
assert "Claude Code not found" in str(exc_info.value)
|
||||
|
||||
anyio.run(_test)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class TestSubprocessCLITransport:
|
|||
):
|
||||
SubprocessCLITransport(prompt="test", options=ClaudeAgentOptions())
|
||||
|
||||
assert "Claude Code requires Node.js" in str(exc_info.value)
|
||||
assert "Claude Code not found" in str(exc_info.value)
|
||||
|
||||
def test_build_command_basic(self):
|
||||
"""Test building basic CLI command."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue