From 247ac33265a1164e63f386349408925af1c8473e Mon Sep 17 00:00:00 2001 From: mkorwel Date: Thu, 23 Oct 2025 13:51:45 -0700 Subject: [PATCH] fix(docker): grant write permissions for npm-global directory Adds a `chown` command to the Dockerfile to grant the `node` user write permissions to the `/usr/local/share/npm-global` directory. This resolves an `EACCES` permission denied error during the `npm install -g` step in the Docker build process. --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 37cccadd61..3b9724cc5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,9 @@ ARG CLI_PACKAGE_NAME ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global ENV PATH=$PATH:/usr/local/share/npm-global/bin +# Ensure the node user has permissions to write to the global npm directory +RUN mkdir -p /usr/local/share/npm-global && chown -R node:node /usr/local/share/npm-global + # Configure npm to use GitHub Packages RUN --mount=type=secret,id=GITHUB_TOKEN \ echo "${NPM_REGISTRY_SCOPE}:registry=${NPM_REGISTRY_URL}" > /home/node/.npmrc && \