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
Error: Command failed with EPIPE #363
Comments
I am also getting the same error in ubuntu 20.4 . Working fine on windows |
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. |
Hello @dudeful |
@Antonyrahul Glad to here that you found an even easier solution! I'm just confused that you were installing, building and deploying you project from an Ubuntu 20.04 environment and you still got this error. Makes me think that we are facing slightly different issues here, since I was able to fix it after just changing my environment to Ubuntu 20.04. Am I getting this right? After facing this issue with OS-dependent packages I started to think about moving to linux for good, since I'm relying 100% on AWS Amazon Linux for running my code. Btw, thanks for open an issue with the package moderators for a more solid fix. |
Hello @dudeful |
Hi @Antonyrahul, thanks for sharing! I wasn't aware of such improvements when using webp compression. I have the same requirements that you mentioned, so I'm probably going with your solution as well. |
Try checking your memory and/or timeout settings for your Lambda. I was able to resolve the intermittent EPIPE errors I was seeing after increasing both. It is likely due to insufficient memory, but I'm mentioning both just in case. Also for reference I was running Node 12 & I had the ImageMagick layer. |
Has there been any developments with this? I'm running into the same issue with trying to compress images with imagemin-mozjpeg in an ubuntu 20.04 environment and haven't been able to find a solution |
I'm running into the same error on macOS. It happens every time with some images, and never with others. When it fails, nothing is written to the output file. Example run: $ imagemin IMG_4034.jpeg --plugin.mozjpeg.quality=80 > IMG_4034.jpg
Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:98:16)
$ ll | grep 4034
-rw-r--r--@ 1 max staff 1.2M Jul 26 22:20 IMG_4034.jpeg
-rw-r--r-- 1 max staff 0B Jul 26 22:41 IMG_4034.jpg If an imagemin developer is interested, I'm happy to provide an example photo that reproduces this. |
Just chipping in with how I resolved this issue on debian 11 bullseye (on M1 mac): FROM --platform=linux/amd64 node:14
COPY ./docker/development/run-node.sh /
RUN apt-get update && apt-get install -y \
autoconf \
make \
libjpeg-progs \
libpng-dev \
multiarch-support \
&& \
wget -O /tmp/libpng12-0.deb http://ftp.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u3_amd64.deb \
&& \
apt install /tmp/libpng12-0.deb \
&& \
chmod +x /run-node.sh
CMD /run-node.sh |
I have install imagemin-mozjpeg and when I optimize jgp image, I get this issue.
The text was updated successfully, but these errors were encountered: