-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some images throw "write EPIPE" error #30
Comments
try this solution: |
Thanks for reply, but |
@laoshu133 Did u find the solution to this? I am experimenting the same issue. |
I'm using gridsome which uses this library. I get this error on GitHub Actions, but not when building locally. |
I just had a similar issue yesterday, on AWS Lambda. In case someone is also facing it, and the development environment is Windows, then I believe this is the solution for you. (note that here in my example I'm using Serverless Framework for building and deploying, however, the principle should work regardless of the use of Serverless) I tried a few different solutions, but the easiest and fastest solution was to install the Windows Subsystem for Linux and run Serverless Deploy from the Ubuntu terminal on windows. The issue is that some packages are OS-dependent, meaning that the same package installed on different OSs are going to produce different installations. Therefore your locally build/run works fine because you installed the packages on Windows environment and you are running the packages code on Windows environment, however, when you deploy to AWS it is now running on Amazon Linux and your packages that are OS-dependant (like mozjpeg, jpegtran, etc) are going to fail during the run. So your best shot is to just install the packages, build and deploy your project from a Linux environment (not sure if all Linux distros fit in this statement, but Ubuntu certainly does). Here's the timeline for what I did:
That's it. |
After hours of research and experimenting with different settings, I managed to resolve My updated Dockerfile:FROM node:12-buster-slim
RUN npm i npm@latest -g
WORKDIR /usr/src
COPY ./app/package*.json ./
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
g++ \
libpng-dev \
make\
nasm \
-y wget \
&& wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb \
&& dpkg -i /tmp/libpng12.deb \
&& rm /tmp/libpng12.deb \
&& npm install --no-optional && npm cache clean --force \
npm install -g gulp \
&& npm install gulp
ENV PATH /usr/src/node_modules/.bin/:$PATH
WORKDIR /usr/src/app
COPY . .
These settings might save you hours of frustration. BTW Node's Happy coding! |
This may not be a bug in the
imagemin-mozjpeg
, but I'm not sure it's a bug in Node.js, so I'm going to make an issue here;I made a simple demo to reproduce this bug, it is an error on stdin, but the spawn of exitcode is right.
DEMO:
https://repl.it/@laoshu133/spawnpipe
The text was updated successfully, but these errors were encountered: