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:
parent
c78e7f3dcc
commit
59e5b2ad77
1 changed files with 8 additions and 0 deletions
|
|
@ -93,8 +93,16 @@ pub fn start_bridge(app: &AppHandle) -> Result<(), String> {
|
|||
|
||||
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")
|
||||
.arg(&script_path)
|
||||
.current_dir(project_dir)
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
|
|
|
|||
Loading…
Reference in a new issue