From fd9caada55d53a43898b6aae7aebc4f3955efd42 Mon Sep 17 00:00:00 2001 From: Bilal EL KOUCHE Date: Sat, 2 May 2026 15:36:02 +0100 Subject: [PATCH] fix: create engine/package.json before npm install to prevent global install Without a package.json in engine/, npm install falls back to a global install inside the portable Node prefix instead of creating a local node_modules/. This causes OC_BIN to never be found, falling through to `npx openclaude` which resolves a wrong package and errors with "could not determine executable to run". Fixes #4 --- start.sh | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 start.sh diff --git a/start.sh b/start.sh old mode 100644 new mode 100755 index 4adf2a1..5da3adb --- a/start.sh +++ b/start.sh @@ -59,6 +59,11 @@ fi export PATH="$NODE_DIR/bin:$PATH" +# Ensure a package.json exists so npm installs locally (not globally) +if [ ! -f "$ENGINE_DIR/package.json" ]; then + echo '{"name":"openclaude-portable","version":"1.0.0","private":true}' > "$ENGINE_DIR/package.json" +fi + if [ ! -d "$ENGINE_DIR/node_modules/@gitlawb/openclaude" ]; then echo -e "${YELLOW}[~] Installing OpenClaude Engine...${RESET}" cd "$ENGINE_DIR"