fix: Remove --ignore-scripts to allow trianglify/canvas to install

The 'i.from is not a function' error occurs because trianglify depends
on canvas, and --ignore-scripts prevented canvas from installing properly.

Solution: Remove --ignore-scripts and allow npm to run install scripts,
but gracefully handle canvas rebuild failures since native bindings
are optional for the production build.
This commit is contained in:
Muhammad Ibrahim
2025-10-28 17:31:39 +00:00
parent 8864de6c15
commit cc46940b0c

View File

@@ -23,7 +23,8 @@ COPY frontend/package*.json ./
RUN npm cache clean --force &&\ RUN npm cache clean --force &&\
rm -rf node_modules ~/.npm /root/.npm &&\ rm -rf node_modules ~/.npm /root/.npm &&\
npm install --ignore-scripts --legacy-peer-deps --no-audit --prefer-online --fetch-retries=3 --fetch-retry-mintimeout=20000 --fetch-retry-maxtimeout=120000 npm install --legacy-peer-deps --no-audit --prefer-online --fetch-retries=3 --fetch-retry-mintimeout=20000 --fetch-retry-maxtimeout=120000 &&\
(npm rebuild canvas || echo "Canvas rebuild failed, continuing without native bindings")
COPY frontend/ ./ COPY frontend/ ./