vbenjs / vite-plugin-imagemin

A vite plugin for compressing image assets.
MIT License
207 stars 28 forks source link

Dependency issue - gifsicle #17

Closed attornai closed 2 years ago

attornai commented 2 years ago

Running npm install vite-plugin-imagemin, including with -force and -peer-legacy-deps flags and @latest option, produces an error seemingly related to the "gifsicle" npm package. Error:

npm i vite-plugin-imagemin@latest                                                                                         9%   780 Mbps  ─╯
npm ERR! code 1
npm ERR! path /Users/yhafez/Documents/Web Projects/AAI/view/node_modules/gifsicle
npm ERR! command failed
npm ERR! command sh -c node lib/install.js
npm ERR! compiling from source
npm ERR! Response code 404 (Not Found)
npm ERR! gifsicle pre-build test failed
npm ERR! Error: Command failed: /bin/sh -c autoreconf -ivf
npm ERR! /bin/sh: autoreconf: command not found
npm ERR! 
npm ERR! 
npm ERR!     at /Users/yhafez/Documents/Web Projects/AAI/view/node_modules/bin-build/node_modules/execa/index.js:231:11
npm ERR!     at runMicrotasks (<anonymous>)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR!     at async Promise.all (index 0)

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yhafez/.npm/_logs/2021-11-24T17_33_44_785Z-debug.log
attornai commented 2 years ago

Resolved using this response: https://github.com/imagemin/imagemin-mozjpeg/issues/11#issuecomment-221399405

brew install automake autoconf libtool and try again.

Looks like autoreconf is a tool that needs to be installed on your local machine for the install to work. Keeping this issue available for reference for others getting this error.