imagemin-gifsicle icon indicating copy to clipboard operation
imagemin-gifsicle copied to clipboard

Install failed [email protected] postinstall

Open vwalexanderjin opened this issue 4 years ago • 24 comments

I thinks there is something wrong with this plugin ...

Error report below:

[email protected] postinstall D:\AppServ\www\test\gulp-project\node_modules\gifsicle node lib/install.js

‼ read ECONNRESET ‼ gifsicle pre-build test failed i compiling from source × Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -ivf" 'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij��� ���������ļ���

at D:\AppServ\www\test\gulp-project\node_modules\execa\index.js:231:11
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 0)

Can anyone help? Really appreciate.

vwalexanderjin avatar Nov 30 '19 08:11 vwalexanderjin

Also have ran into this issue after updating to [email protected]. Getting this error when running yarn install:

warning Error running install script for optional dependency: "/cutter/public_html/wp-content/themes/wp-base-theme/node_modules/gifsicle: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments:
Directory: /cutter/public_html/wp-content/themes/wp-base-theme/node_modules/gifsicle
Output:
⚠ Command failed: /cutter/public_html/wp-content/themes/wp-base-theme/node_modules/gifsicle/vendor/gifsicle --version
/cutter/public_html/wp-content/themes/wp-base-theme/node_modules/gifsicle/vendor/gifsicle: 1: /cutter/public_html/wp-content/themes/wp-base-theme/node_modules/gifsicle/vendor/gifsicle: Syntax error: \"(\" unexpected


  ⚠ gifsicle pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c autoreconf -ivf
/bin/sh: 1: autoreconf: not found

Been trying hunt down to see if others have been having this issue but I'm not having much luck. I've seen people with similar issues, but haven't really found a solid solution. I found this that I haven't tried yet, but it seems a little ridiculous to have to install each of these plugins separately when they should be bundled with gulp-imagemin. I'll circle back if I get it working.

GULP_VERSION 4.0.2
NODE_VERSION 12.14.0
YARN_VERSION 1.15.2

jrjacobs24 avatar Jan 03 '20 19:01 jrjacobs24

@jrjacobs24 Same problem. I had to install dh-autoreconf and my build worked again. I'm installing in a docker image based on node:12-slim (which is based on debian:stretch-slim). Worked fine on macOS.

apt-get install dh-autoreconf

joemaller avatar Jan 23 '20 21:01 joemaller

I have probably the same issue that is fixed by using:

apt-get install dh-autoreconf

Kinda weird that we need another dependency for using this package? The issue it solves:

Output: ⚠ Response code 404 (Not Found) ⚠ gifsicle pre-build test failed ℹ compiling from source ✖ Error: Command failed: /bin/sh -c autoreconf -ivf /bin/sh: 1: autoreconf: not found

Levdbas avatar Jan 24 '20 12:01 Levdbas

@joemaller @Levdbas That's awesome. Thank you for commenting back. I'll give dh-autoreconf a try. I'll update to confirm that if it worked or not. What led you to install that package to begin with?

jrjacobs24 avatar Jan 25 '20 21:01 jrjacobs24

@joemaller @Levdbas That's awesome. Thank you for commenting back. I'll give dh-autoreconf a try. I'll update to confirm that if it worked or not. What led you to install that package to begin with?

The /bin/sh: 1: autoreconf: not found point to an executable on the local system. Googling it leads to dh-autoreconf

Levdbas avatar Jan 27 '20 08:01 Levdbas

But apt-get install dh-autoreconf seems not a solution for Windows? Are there any solutions to solve the problem fundamentally?

littlegrayss avatar Feb 18 '20 08:02 littlegrayss

Similarly, I have yet to find a package(s) that I can install when using Alpine Linux in a docker image. Alpine does not have a dh-autoreconf package, and trying with autoconf automake gcc does not work either.

kcoyner avatar Mar 14 '20 10:03 kcoyner

Is there a windows solution here? Having the same issues. Thanks

Coop920 avatar Apr 03 '20 03:04 Coop920

Here are my way to fix this question in windows: run this in cmd

npm install -g npm bower gulp
npm install -g gifsicle

Hope to help you!

taokexia avatar Apr 19 '20 09:04 taokexia

I fixed this by cnpm install gifsicle... it's quite strange, I run npm install with global VPN, it failed but worked out with cnpm

chase-si avatar Apr 21 '20 06:04 chase-si

This issue is very annoying when you don't own your Devops process. Its there a reason why we need external tools outside of npm to install JavaScript packages. Seems so weird to me. Can the owner of these packages share some light on it

richie50 avatar Apr 30 '20 20:04 richie50

Same here, using this with an automated DevOps pipeline in an isolated docker container breaks the entire build.

saaymeen avatar May 08 '20 11:05 saaymeen

Same here, using this with an automated DevOps pipeline in an isolated docker container breaks the entire build.

Exactly if you are behind a corporate proxy say goodbye to this package.

richie50 avatar May 13 '20 17:05 richie50

brew install automake This should help for the MacOs users.

aamiriqubal avatar Jun 15 '20 08:06 aamiriqubal

@joemaller thanks guy

thalysonalexr avatar Jun 16 '20 15:06 thalysonalexr

Chinese developers:

fix gifsicle pre-build test failed

  1. hosts
# GitHub Start
52.74.223.119 github.com
192.30.253.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
151.101.76.133 raw.githubusercontent.com
# GitHub End
  1. and then, yarn install

xianghongai avatar Sep 04 '20 03:09 xianghongai

I have solved this problem. The reason for this problem is that the network cannot access raw.githubusercontent.com, you can ping it to verify

xrcdev avatar Oct 10 '20 12:10 xrcdev

autoreconf does not come installed by default in Amazin Linux, hence it is not easy to install in any Vercel build image, making it very hard to use this package in NextJS and another alike frameworks at deployment in the Vercel platform.

SalahAdDin avatar Nov 25 '20 20:11 SalahAdDin

Similarly, I have yet to find a package(s) that I can install when using Alpine Linux in a docker image. Alpine does not have a dh-autoreconf package, and trying with autoconf automake gcc does not work either.

I managed to fix installing on Alpine through the comment of @chadyred here: https://lifesaver.codes/answer/error-getting-optipng-enoent-in-ttf2woff2.

Not sure which packages you need just for gifsicle because the post is about jpegtran and optipng as well, but when adding all of these the gifsicle postinstall script works:

RUN apk --update --no-cache \
		add  \
		automake \
		git \
		alpine-sdk  \
		nasm  \
		autoconf  \
		build-base \
		zlib \
		zlib-dev \
		libpng \
		libpng-dev\
		libwebp \
		libwebp-dev \
		libjpeg-turbo \
		libjpeg-turbo-dev

stijnjanmaat avatar Feb 02 '21 19:02 stijnjanmaat

i solved the problem by using below: hope it helps someone. RUN apk add --no-cache autoconf

arianpopalyar avatar Mar 01 '21 21:03 arianpopalyar

If anyone is here because of Alpine, you may need Docker 20.

We use AWS Codebuild for CD for example, and they only support 19: rodrigo/seed-3500-download-docker-20-in-codebuild

rclmenezes avatar Oct 14 '21 17:10 rclmenezes

This work for me

FROM node:16-alpine
RUN apk --update --no-cache add \
    libc6-compat \
    automake \
    autoconf \
    build-base \
    zlib \
    zlib-dev

linhhuynhal avatar Nov 30 '21 14:11 linhhuynhal

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: node lib/install.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: `

woizran avatar Mar 31 '22 09:03 woizran

For Docker users, do not use alpine, use debian-slim instead.

Loongphy avatar Jan 22 '24 07:01 Loongphy