Skip to content

Commit 0f63400

Browse files
committed
fix: configure user-scoped npm global prefix for vscode user to avoid EACCES
1 parent 25a23df commit 0f63400

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.devcontainer/ai-container/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ RUN set -eux; \
5151
# Install Claude Code, Gemini CLI, Codex CLI, and Crush globally via npm
5252
RUN npm install -g @anthropic-ai/claude-code @google/gemini-cli @openai/codex @charmland/crush
5353

54+
# Configure a user-scoped npm global prefix for the vscode user to avoid EACCES
55+
# when running `npm install -g` inside Codespaces.
56+
RUN mkdir -p /home/vscode/.npm-global \
57+
&& chown -R vscode:vscode /home/vscode/.npm-global
58+
USER vscode
59+
RUN npm config set prefix ~/.npm-global
60+
USER root
61+
# Ensure the user npm bin is on PATH for interactive shells and Docker execs
62+
ENV PATH="/home/vscode/.npm-global/bin:${PATH}"
63+
RUN printf 'export PATH="/home/vscode/.npm-global/bin:$PATH"\n' > /etc/profile.d/npm-global.sh
64+
5465
# Install Wassette from source using Cargo
5566
ARG DEBIAN_FRONTEND=noninteractive
5667
ARG WASSETTE_REF=main

0 commit comments

Comments
 (0)