Fix: Bridge-Prozess im Projektverzeichnis starten (node_modules)

current_dir() auf Projektroot setzen damit Node.js die
node_modules/@anthropic-ai/sdk findet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Eddy 2026-04-13 20:57:31 +02:00
parent c78e7f3dcc
commit 59e5b2ad77

View file

@ -93,8 +93,16 @@ pub fn start_bridge(app: &AppHandle) -> Result<(), String> {
println!("🔌 Starte Claude Bridge: {:?}", script_path); println!("🔌 Starte Claude Bridge: {:?}", script_path);
// Arbeitsverzeichnis = Projektroot (wo node_modules liegt)
let project_dir = script_path.parent()
.and_then(|p| p.parent())
.unwrap_or_else(|| std::path::Path::new("."));
println!("📂 Bridge Arbeitsverzeichnis: {:?}", project_dir);
let mut child = Command::new("node") let mut child = Command::new("node")
.arg(&script_path) .arg(&script_path)
.current_dir(project_dir)
.stdin(Stdio::piped()) .stdin(Stdio::piped())
.stdout(Stdio::piped()) .stdout(Stdio::piped())
.stderr(Stdio::piped()) .stderr(Stdio::piped())