fix: install n2-soul with --ignore-scripts, then upgrade better-sqlite3
PR Checks / hadolint (pull_request) Successful in 6s
PR Checks / build-test (pull_request) Failing after 39s

n2-soul's npm install fails on Node 26 because its dependency
better-sqlite3@11.10.0 cannot compile (V8 API removed GetPrototype).
The subsequent upgrade to v12 never runs due to set -eux.

Fix: install n2-soul without scripts, then replace better-sqlite3
with v12.11.1 which has prebuilt binaries for Node 26.

open-code-ai is installed separately with scripts allowed.
This commit is contained in:
Hermes Agent
2026-07-13 23:26:20 +00:00
parent 523c39808f
commit 988bf26667
+4 -2
View File
@@ -13,8 +13,10 @@ RUN apt-get update && \
groupadd -g 1000 opencode; \ groupadd -g 1000 opencode; \
useradd -m -u 1000 -g 1000 -s /usr/bin/bash opencode; \ useradd -m -u 1000 -g 1000 -s /usr/bin/bash opencode; \
npm update -g --no-fund --no-audit && \ npm update -g --no-fund --no-audit && \
npm install -g --no-fund --no-audit --allow-scripts=opencode-ai,better-sqlite3 opencode-ai@1.17.18 n2-soul@9.0.9 && \ npm install -g --no-fund --no-audit --ignore-scripts n2-soul@9.0.9 && \
(cd /usr/local/lib/node_modules/n2-soul && npm install --no-fund --no-audit --no-save better-sqlite3@12.11.1) && \ rm -rf /usr/local/lib/node_modules/n2-soul/node_modules/better-sqlite3 && \
(cd /usr/local/lib/node_modules/n2-soul && npm install --no-fund --no-audit --no-save --allow-scripts=better-sqlite3 better-sqlite3@12.11.1) && \
npm install -g --no-fund --no-audit --allow-scripts=opencode-ai opencode-ai@1.17.18 && \
npm cache clean --force && \ npm cache clean --force && \
chown -R 1000:1000 /usr/local/lib/node_modules/n2-soul/ chown -R 1000:1000 /usr/local/lib/node_modules/n2-soul/