How to install libpng-dev on windows?

I am trying to install the imagemin-pngquant module for node:

https://www.npmjs.org/package/imagemin-pngquant

However, when I run the command

npm install imagemin-pngquant --save-dev 

I get the following error:

  warn : pngquant pre-build test failed info : compiling from source error : Error: pngquant failed to build, make sure that libpng-dev is installed at ChildProcess.exithandler (child_process.js:637:15) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:735:16) at Socket.<anonymous> (child_process.js:948:11) at Socket.EventEmitter.emit (events.js:95:17) at Pipe.close (net.js:466:12) 

How to install libpng-dev library required by pngquant?

+5
source share
1 answer

I had a similar problem with the lack of libpng-dev when installing gulp -imagemin on Windows. I found out that libpng-dev does not exist for Windows, only for MacOS and Linux. Here is the error message I received:

 enter > node lib/install.js ‼ Request to https://raw.github.com/imagemin/pngquant-bin/v3.0.0/vendor/win/pngquant.exe failed ‼ pngquant pre-build test failed i compiling from source × Error: pngquant failed to build, make sure that libpng-dev is installed at ChildProcess.exithandler (child_process.js:744:12) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1008:16) at Socket.<anonymous> (child_process.js:1176:11) at Socket.emit (events.js:107:17) at Pipe.close (net.js:476:12) 

So, I tried installing pngquant-bin with

 npm install --save-dev pngquant-bin 

but received more or less than one error message. Pay attention to the version number 3.0.0. Then I tried to install pngquant (without -dev) as follows:

 npm install --save-dev pngquant --msvs_version=2013 

and he successfully installed pngquant version 2.0.0. After that, I can also install gulp -imagemin.

I'm not sure, although if the 2013 version of the library played a role here.

+1
source

Source: https://habr.com/ru/post/1205331/


All Articles