iotbzh / helloworld-html-application

An HTML5 application example for AGL
Apache License 2.0
3 stars 3 forks source link

pngquant "binary doesn't seem to work correctly", libpng-dev is installed #4

Open KernelDeimos opened 5 years ago

KernelDeimos commented 5 years ago

I received the following error when trying to run make widget. I'm unsure how to proceed with debugging this

> node lib/install.js

  ⚠ The `/home/devel/mirror/helloworld-html-application/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/devel/mirror/helloworld-html-application/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pngquant-bin@4.0.0 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pngquant-bin@4.0.0 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:
npm ERR!     /home/devel/.npm/_logs/2018-12-13T19_25_30_472Z-debug.log
app/CMakeFiles/helloworld-app.dir/build.make:60: recipe for target 'app/dist.dev' failed
make[3]: *** [app/dist.dev] Error 1
CMakeFiles/Makefile2:454: recipe for target 'app/CMakeFiles/helloworld-app.dir/all' failed
make[2]: *** [app/CMakeFiles/helloworld-app.dir/all] Error 2
CMakeFiles/Makefile2:307: recipe for target 'CMakeFiles/widget.dir/rule' failed
make[1]: *** [CMakeFiles/widget.dir/rule] Error 2
Makefile:255: recipe for target 'widget' failed
make: *** [widget] Error 2
KernelDeimos commented 5 years ago

Actually it turns out the source of the issue runs deeper...

https://github.com/imagemin/pngquant-bin/issues/78

KernelDeimos commented 5 years ago

The following (from the issue above) seems to work to install pngquant-bin globally, but unfortunately that doesn't stop the build script from failing

npm install -g pngquant-bin --allow-root --unsafe-perm=true

Edit: Running the following (also from the issue above) in the Docker container fixes the issue: wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb && sudo dpkg -i /tmp/libpng12.deb && rm /tmp/libpng12.deb - it seems like an older version of libpng than the one installed is required. Additionally, I had to manually install the gulp package. Maybe sudo npm install -g gulp should be added to the readme