sindresorhus / gulp-imagemin

Minify PNG, JPEG, GIF and SVG images
MIT License
1.9k stars 157 forks source link

cannot install optional dependence mozjpeg #339

Open selinaJiang opened 4 years ago

selinaJiang commented 4 years ago

stuck into this error when npm install:

gifsicle@5.0.0 postinstall /Users/jiangsigui/2019_lexin_leka_group/testDir/mini0210/node_modules/gifsicle node lib/install.js

⚠ connect ECONNREFUSED 151.101.228.133:443 ⚠ gifsicle pre-build test failed ℹ compiling from source ✖ Error: Command failed: /bin/sh -c autoreconf -ivf autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --output=aclocal.m4t Can't exec "aclocal": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326. autoreconf: failed to run aclocal: No such file or directory

at Promise.all.then.arr (/Users/jiangsigui/2019_lexin_leka_group/testDir/mini0210/node_modules/bin-build/node_modules/execa/index.js:231:11)
at process._tickCallback (internal/process/next_tick.js:68:7)

mozjpeg@6.0.1 postinstall /Users/jiangsigui/2019_lexin_leka_group/testDir/mini0210/node_modules/mozjpeg node lib/install.js

⚠ connect ECONNREFUSED 151.101.228.133:443 ⚠ mozjpeg pre-build test failed ℹ compiling from source

Northward-Design commented 4 years ago

I am having a similar issue with v7.1.0 on Ubuntu But only with gifsicle not mozjpeg. My current solution is to install gulp-imagemin@7.0.0

gifsicle@5.0.0 postinstall /home/user/Projects/.srcs/github.com/folder-name/gulp-ingredients-test/test-op-img/node_modules/gifsicle node lib/install.js

⚠ 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

at Promise.all.then.arr (/home/user/Projects/.srcs/github.com/folder-name/gulp-ingredients->test/test-op-img/node_modules/bin-build/node_modules/execa/index.js:231:11) at at process._tickCallback (internal/process/next_tick.js:188:7)

mozjpeg@6.0.1 postinstall /home/user/Projects/.srcs/github.com/folder-name/gulp-ingredients-test/test-op-img/node_modules/mozjpeg node lib/install.js

✔ mozjpeg pre-build test passed successfully

optipng-bin@6.0.0 postinstall /home/user/Projects/.srcs/github.com/folder-name/gulp-ingredients-test/test-op-img/node_modules/optipng-bin node lib/install.js

✔ optipng pre-build test passed successfully npm WARN test-op-img@0.0.1 No description npm WARN test-op-img@0.0.1 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: gifsicle@5.0.0 (node_modules/gifsicle): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: gifsicle@5.0.0 postinstall: node lib/install.js npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

  • gulp-imagemin@7.1.0 added 274 packages from 197 contributors and audited 10521 packages in 28.12s found 0 vulnerabilities
Unequaled804 commented 4 years ago

Try brew install automake if you're using macOS This works well for me

pcate-fls commented 3 years ago

I am having a similar issue with v7.1.0 on Ubuntu But only with gifsicle not mozjpeg. My current solution is to install gulp-imagemin@7.0.0

I had the same issue. Pinning gulp-imagemin to 7.0 fixed the issue for me as well.

Northward-Design commented 3 years ago

@sindresorhus Please take a look when you get some time. Happy Holidays!

bruceeewong commented 3 years ago

if macOS,try to use brew to install all dependencies of mozjpeg:

brew install libtool automake autoconf nasm

by now reinstall mozjpeg should get pass。

or clear local dependencies then retry:

rm -rf node_modules
npm cache clean --force
npm install

hope it helps.