Open anthonyaam opened 6 years ago
i have de same problem
It still fails for me with version 5.0.1
. I have to add this line to my Dockerfile
apt-get install libpng-dev -y --no-install-recommends
What's the last known good version of this library?
Same problem on Win10
Faced the same issue.
Fixed by using older imagemin-pngquan
and pngquant-bin
library versions
npm install imagemin-pngquant@5.0.1 --save
npm install pngquant-bin@3.1.1 --save```
npm i -D imagemin-pngquant@5.0.1
Fixed the issue, with 4 moderate severity vulnerabilities...
The upgrade from 5.0.1 to 5.1.0 should have been a major version increase, not a minor. webpack-image-loader specifies ^5.0.0 as its dependency, meaning you need to manually edit the npm or yarn lock file to avoid this issue. A major version increment would avoid this issue.
On a fresh laravel Install, I am getting these problems. Tried series of recommendations:
tried : rm -rf node_modules rm package-lock.json yarn.lock npm cache clear --force npm install
tried: npm install cross-env
tried: npm install imagemin-pngquant@5.0.1 --save npm install pngquant-bin@3.1.1 --save
tried switching cross-env NODE_ENV= to node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=
Nothing worked... I'm out of options. Anyone else managed to get passed this? Again, this is a FRESH install.
Just realised I'm one of those terrible people who posts a problem online but never posts the solution.
I fixed this issue using yarn by adding the following to my package.json "resolutions": { "image-webpack-loader/imagemin-pngquant": "5.0.1" }
@NewDiogenes Ahh.. the smallest glimmer of hope. Still getting this:
`> npm run development -- --watch
npm WARN invalid config loglevel="notice"
> @ development C:\Users\myuser\Code\laravel_fresh_test
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
module.js:549
throw err;
^
Error: Cannot find module 'C:\Users\myuser\Code\laravel_fresh_test\node_modules\laravel-mix\setup\webpack.config.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at requireConfig (C:\Users\myuser\Code\laravel_fresh_test\node_modules\webpack\bin\convert-argv.js:97:18)
at C:\Users\myuser\Code\laravel_fresh_test\node_modules\webpack\bin\convert-argv.js:104:17
at Array.forEach (<anonymous>)
at module.exports (C:\Users\myuser\Code\laravel_fresh_test\node_modules\webpack\bin\convert-argv.js:102:15)
at yargs.parse (C:\Users\myuser\Code\laravel_fresh_test\node_modules\webpack\bin\webpack.js:171:41)
at Object.Yargs.self.parse (C:\Users\myuser\Code\laravel_fresh_test\node_modules\yargs\yargs.js:533:18)`
Any help GREATLY appreciated!
Looks to me that the path to webpack.config.js is incorrect. I would recommend you not use the config file of a dependency like that, but instead copy it across into you project root. Otherwise, double check that the file actually exists at that path.
For those like me who struggled with this even after trying all the solutions recommended, here is what I did to finally get it to work for me.
I deleted the node_modules folder (rm -rf node_modules) I rebooted my computer I disabled my Anti-virus I compared my package.json to a fresh install and removed any packages that I thought might of caused issue I ran npm install
Then it worked. Ultimately, I think the culprit might of been my anti-virus (Kaspersky). It's caused some issues before with some packages, which if really is a hassle, because when ever you run npm install / update, npm gives you an ok status even though some files might failed.
@NewDiogenes Thanks for your help! Wasn't the actual problem, but it's appreciated anyways!
in my case, the error happened because I was using ubuntu 18 and I was trying to run react-boilerplate, so at first the error was the image-webpack-loader, I have tried to install its dependencies and to match the versions and using older versions, but it was solved when I have installed libpng-dev on ubuntu
sudo apt-get install libpng-dev
then I have tried the steps of installing boilerplate in a new repo and now it works.
Just realised I'm one of those terrible people who posts a problem online but never posts the solution.
I fixed this issue using yarn by adding the following to my package.json "resolutions": { "image-webpack-loader/imagemin-pngquant": "5.0.1" }
Thanks @NewDiogenes! This is the only solution that worked for me and I've been trying to fix it for a few hours now :cry:
Faced the same issue. Fixed by using older
imagemin-pngquan
andpngquant-bin
library versionsnpm install imagemin-pngquant@5.0.1 --save npm install pngquant-bin@3.1.1 --save```
Only this single line worked:
npm install imagemin-pngquant@5.0.1 --save
[OS: Windows]
To get this fixed I had to install libpng-devel, automake, libtool, autoconf. Then I got it compiled successfully.
Maybe it will help somebody.
To get this fixed I had to install libpng-devel, automake, libtool, autoconf. Then I got it compiled successfully.
It works for me, thanks! Little fix: libpng-dev, not libpng-devel
@Ke100n4ik it is devel in Redhat/Fedora Linux. In Ubuntu/Debian it is dev.
For me on Windows it was Kaspersky all along (thanks, evinkuraga). Disabling anti-virus fixed everything without any additional actions.
Tried every suggestion above, but none worked. Then I installed Visual C++ Redistributable for Visual Studio 2015 both x86 and x64 packages, and everything worked instantly. Maybe this would help
@bugleev what OS are you working on?
I just ran into the issue on npm 3.5.2, npm 6.4.1 worked fine. I could solve it for npm 3 with the fix from @adsingh14 .
npm install imagemin-pngquant@5.0.1 --save
Just make sure the dependency gets added in package.json
without the semver range operator, so it should be "imagemin-pngquant": "5.0.1"
not "imagemin-pngquant": "^5.0.1"
(in that case, 5.1.*
would be installed again). Apparently there is a npm --save-exact
switch, but at least in npm3 this does not work.
I am getting increasingly frustrated by this issue. No matter what I do, this is where I end up:
⚠ The `/home/redacted/node_modules/imagemin-pngquant/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
⚠ pngquant pre-build test failed
ℹ compiling from source
✔ pngquant pre-build test passed successfully
✖ Error: pngquant failed to build, make sure that libpng-dev is installed
at Promise.all.then.arr (/home/redacted/node_modules/bin-build/node_modules/execa/index.js:231:11)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
We're on RHEL 7.6
Is there anything I'm missing?
Make sure you have all the prerequisites installed
sudo apt install -y build-essential libpng-dev
I found my solution for alpine in https://github.com/imagemin/pngquant-bin/issues/78 There are many more other solutions. Have a look there if nothing from here works for you.
On a mac simply running
brew install libpng
worked for me.
On a mac I'm getting:
npm install pngquant-bin@5.0.1 --save
> pngquant-bin@5.0.1 postinstall /Users/hbrems/dev/apps/imager/node_modules/pngquant-bin
> node lib/install.js
⚠ Response code 503 (Backend unavailable, connection timeout)
⚠ pngquant pre-build test failed
ℹ compiling from source
✖ Error: pngquant failed to build, make sure that libpng is installed
at Promise.all.then.arr (/Users/hbrems/dev/apps/imager/node_modules/bin-build/node_modules/execa/index.js:231:11)
at process._tickCallback (internal/process/next_tick.js:68:7)
What is the backend it's trying to connect to?
raw.github.com is down / having issues right now
@aetherix looks like this is the issue right now https://github.com/imagemin/pngquant-bin/pull/99
waiting for that fix to get merged
@Kcharle @miket2marcom Good to hear that there's a fix inbound. Thank you for the replies.
still getting × Error: pngquant failed to build, make sure that libpng-dev is installed. I'm wet behind the ears, so I'm sure there are some things I can try to fix it. here's what I've done so far: npm update -g gatsby-cli npm uninstall -g gatsby-cli npm i libpng-dev npm i gatsby-plugin-sharp" npm i build-essential libpng-dev
this is all on a fresh install, any suggestions?
To get this fixed I had to install libpng-devel, automake, libtool, autoconf. Then I got it compiled successfully.
Maybe it will help somebody.
Awesome.. Just add "make" & "gcc" to the install list.. and it worked like a charm
Thanks Its Working apt-get install -y gcc make libpng-dev
I'm using ubuntu 18.04 I'm try sudo apt-get install libpng-dev It's work for me, thanks
In Centos 7, npm install libpng-devel
worked for me
In windows 10, installation of visual studio community version helps me.
brew upgrade libpng
That did it for me.
Windows Users:
Windows 10 users, if you follow @hkniyi steps and still cannot install, your corporate firewall might be blocking the download. We had an https proxy firewall blocking it and that was the problem for me.
It works for me "resolutions": { "image-webpack-loader/imagemin-pngquant": "5.0.1" }
on ubuntu 18 as a normal user, this would constantly error with all the apt dependancies installed, this is for an old version of roots.io sage Wordpress starter theme which has been moved from ubuntu 16 to 18.
Using @AshokAK12 option above in the package.json file allowed npm install to finish and we can now run yarn run build successfully, thank you
@hkniyi could you breifly explain what you changed in this zip file?
@HassanNemir thanks bro , a life saver answer
$ npm install imagemin-pngquant npm ERR! code ETARGET npm ERR! notarget No matching version found for ow@^0.13.2 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! notarget npm ERR! notarget It was specified as a dependency of 'imagemin-pngquant' npm ERR! notarget
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\count\AppData\Roaming\npm-cache_logs\2019-11-03T21_25_36_299Z-debug.log
Help please
I had the same issue but it is resolved by first installing libpng-dev using this command: sudo apt-get install libpng-dev
in my case, the error happened because I was using ubuntu 18 and I was trying to run react-boilerplate, so at first the error was the image-webpack-loader, I have tried to install its dependencies and to match the versions and using older versions, but it was solved when I have installed libpng-dev on ubuntu
sudo apt-get install libpng-dev
then I have tried the steps of installing boilerplate in a new repo and now it works.
This works for Ubuntu 18. Thanks manh. You saved my day!
I finally fixed this issue by just installing these packages:
apt install bash gcc make libpng-dev
why not use a precompiled wasm variant of pngquant?
On Ubuntu you can try to fix it with apt-get install -y libpango1.0-dev
command, worked for older node v6
Had the same issue. After trying all of the above answers without success I deleted node_modules folder and installed everything from the beginning:
rm -r node_modules
npm install
Por favor alguna solución para Windows!!! Gracias! He intentado todos los metodos y nada que funciona todavia
npm install fails with
pngquant failed to build, make sure that libpng is installed
.This pngquant-bin issue describes the problem in the pngquant-bin dependency.