Skip to content

Commit 58fc845

Browse files
geroplona-agent
andcommitted
Fix npm-tools installation permissions in dev/image
Add chown command to fix EACCES permission error when installing npm-tools. The COPY command creates files owned by root, but npm ci runs as gitpod user and needs write access to create node_modules. Changes: - Add 'sudo chown -R gitpod:gitpod /opt/npm-tools' before npm ci - This ensures the gitpod user can write to /opt/npm-tools/node_modules/ Error fixed: npm error code EACCES npm error syscall mkdir npm error path /opt/npm-tools/node_modules npm error errno -13 Co-authored-by: Ona <no-reply@ona.com>
1 parent 0fda88f commit 58fc845

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dev/image/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ RUN sudo rm -f /usr/bin/npx /usr/local/bin/npx /home/gitpod/.nvm/versions/node/v
144144

145145
# Install npm-tools with locked dependencies
146146
COPY dev-npm-tools--pkg/package.json dev-npm-tools--pkg/package-lock.json /opt/npm-tools/
147-
RUN cd /opt/npm-tools && \
147+
RUN sudo chown -R gitpod:gitpod /opt/npm-tools && \
148+
cd /opt/npm-tools && \
148149
npm ci && \
149150
for bin in /opt/npm-tools/node_modules/.bin/*; do \
150151
sudo ln -sf "$bin" /usr/local/bin/$(basename "$bin"); \

0 commit comments

Comments
 (0)