fix: install better-sqlite3 globally, remove local copy in n2-soul
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:
+2
-2
@@ -4,7 +4,7 @@ ENV NPM_CONFIG_UPDATE_NOTIFIER=false \
|
|||||||
NPM_CONFIG_LOGLEVEL=warn \
|
NPM_CONFIG_LOGLEVEL=warn \
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
|
|
||||||
# hadolint ignore=DL3003
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get upgrade -y --no-install-recommends ca-certificates && \
|
apt-get upgrade -y --no-install-recommends ca-certificates && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
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; \
|
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 --ignore-scripts n2-soul@9.0.9 && \
|
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 && \
|
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 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/
|
||||||
|
|||||||
Reference in New Issue
Block a user