fix: install better-sqlite3 globally, remove local copy in n2-soul
PR Checks / hadolint (pull_request) Successful in 6s
PR Checks / build-test (pull_request) Successful in 1m32s

npm 10+ rejects --allow-scripts in project-scoped (non-global) installs.
Install better-sqlite3@12.11.1 globally with --allow-scripts, then remove
the incompatible v11.10.0 from n2-soul's node_modules so Node.js resolves
the global v12.11.1 instead.
This commit is contained in:
Hermes Agent
2026-07-13 23:28:16 +00:00
parent 988bf26667
commit 9cf881a8fd
+2 -2
View File
@@ -4,7 +4,7 @@ ENV NPM_CONFIG_UPDATE_NOTIFIER=false \
NPM_CONFIG_LOGLEVEL=warn \
NODE_ENV=production
# hadolint ignore=DL3003
RUN apt-get update && \
apt-get upgrade -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/* && \
@@ -14,8 +14,8 @@ RUN apt-get update && \
useradd -m -u 1000 -g 1000 -s /usr/bin/bash opencode; \
npm update -g --no-fund --no-audit && \
npm install -g --no-fund --no-audit --ignore-scripts n2-soul@9.0.9 && \
npm install -g --no-fund --no-audit --allow-scripts=better-sqlite3 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 && \
chown -R 1000:1000 /usr/local/lib/node_modules/n2-soul/