fix: Remove entire npm cache directory to fix corrupted tarball issue

The get-intrinsic package tarball is getting corrupted in the npm cache.
By removing ~/.npm entirely and fetching fresh packages, we avoid the
corrupted cache issue that's causing the string_decoder error.
This commit is contained in:
Muhammad Ibrahim
2025-10-28 16:19:25 +00:00
parent 0f5272d12a
commit e4d6c1205c

View File

@@ -47,10 +47,11 @@ COPY --chown=node:node backend/ ./backend/
WORKDIR /app/backend
RUN npm cache clean --force &&\
rm -rf node_modules &&\
npm ci --ignore-scripts --legacy-peer-deps &&\
rm -rf node_modules ~/.npm &&\
npm ci --ignore-scripts --legacy-peer-deps --no-audit &&\
npx prisma generate &&\
npm prune --omit=dev
npm prune --omit=dev &&\
npm cache clean --force
# Production stage
FROM node:lts-alpine