Fix npm permission error for bird skill installation in Docker

Fixes #4130

When running as the non-root 'node' user in Docker, npm global
installs fail with EACCES errors because /usr/local/lib/node_modules
is owned by root.

This commit configures npm to use a user-writable directory
(/home/node/.npm-global) for global packages, allowing skills like
bird (@steipete/bird) to install successfully.

Changes:
- Set npm prefix to /home/node/.npm-global after USER node directive
- Add the new npm global bin directory to PATH

This follows Docker best practices for npm global installs in
non-root containers and fixes all npm-based skill installations.
This commit is contained in:
spiceoogway 2026-01-30 03:18:52 -05:00
parent bd214dc061
commit c8c74e50ad

View File

@ -37,4 +37,10 @@ ENV NODE_ENV=production
# This reduces the attack surface by preventing container escape via root privileges
USER node
# Configure npm to use a user-writable directory for global packages
# This prevents EACCES errors when installing skills that use npm packages
# (e.g., bird skill: @steipete/bird)
RUN npm config set prefix /home/node/.npm-global
ENV PATH="/home/node/.npm-global/bin:${PATH}"
CMD ["node", "dist/index.js"]