fix: rm bundled camoufox-js instead of --prefix override
--prefix installs inside the daemon's node_modules but doesn't actually replace the bundled file. Node resolves the nested node_modules/camoufox-js/ first and never sees the global copy. Fix: simply rm -rf the bundled camoufox-js directory so Node falls through to the globally installed v0.11.0.
This commit is contained in:
17
install.sh
17
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)..."
|
||||
|
||||
Reference in New Issue
Block a user