From cb77ba84a0697b4cc91a257bb7901597b9b380a4 Mon Sep 17 00:00:00 2001 From: Tara Menon Date: Sat, 13 Jun 2026 19:42:43 +0530 Subject: [PATCH] fix: rm bundled camoufox-js instead of --prefix override --- install.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 9ade82b..be6d8c1 100755 --- a/install.sh +++ b/install.sh @@ -231,18 +231,19 @@ install_camoufox_browser() { # Step 2: Override bundled camoufox-js@0.9.3 with v0.11.0 # The daemon does: import("camoufox-js") — Node resolves this from - # the daemon's own node_modules/, NOT global node_modules. - # So a global install won't fix it — we must install inside the package. + # the daemon's own node_modules/ FIRST, before checking global. + # So we must REMOVE the bundled copy so Node falls through to global. info "Upgrading bundled camoufox-js to v0.11.0 (daemon dependency)..." local cb_pkg cb_pkg="$(npm root -g 2>/dev/null)/camoufox-browser" - if [ -d "$cb_pkg" ]; then - npm install --prefix "$cb_pkg" camoufox-js@0.11.0 2>&1 | tail -3 || { - warn "Failed to upgrade camoufox-js in $cb_pkg" - } - else - warn "Could not find camoufox-browser package directory at $cb_pkg" + if [ -d "$cb_pkg/node_modules/camoufox-js" ]; then + rm -rf "$cb_pkg/node_modules/camoufox-js" + ok "Removed bundled camoufox-js@0.9.3 from daemon package" fi + # Ensure global v0.11.0 exists + npm install -g camoufox-js@0.11.0 2>&1 | tail -3 || { + warn "Failed to install camoufox-js@0.11.0 globally" + } # Step 3: Download browser binary info "Downloading Camoufox browser binary (~311MB)..."