5

I installing npm and all works until this error, I am trying to discover what its causing this problem but no success. After the installation I tried to run 'npm run dev' but with errors too. I guess because the problem with the npm install at all. I tried to install the module pngquant-bin but no success too.

If you know a way or you face this same problem already, please help me. I see the other questions about it but with any responses. Please.

pngquant-bin@4.0.0 postinstall /var/www/html/futebit/node_modules/pngquant-bin node lib/install.js

  ⚠ The `/var/www/html/futebit/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 (/var/www/html/futebit/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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!     /root/.npm/_logs/2018-07-16T14_17_27_195Z-debug.log
Luciano
  • 358
  • 1
  • 5
  • 17

3 Answers3

3

Pngquant require vcruntime140.dll. Download and install 64bit and 32bit Visual C++ Redistributable for Visual Studio 2015 from https://www.microsoft.com/en-in/download/details.aspx?id=48145

Dev Trex
  • 67
  • 1
  • 6
0

The error states make sure that libpng-dev is installed. That means that you are probably missing that package.

On Debian/Ubuntu you can fix it with sudo apt install libpng-dev. That worked for me.

Mr. Goferito
  • 6,391
  • 4
  • 26
  • 27
0

It seems you are trying to use the precompiled binary pngquant-bin and it fails because of incompatible libraries used in the OS, so two ways to use them:

  1. Install system-wide pngquant package apart the node package

  2. If you are using an old OS try upgrade the libraries then install the node package again

  3. In case you have the newest OS, try upgrade the node package to the newest version too.

Малъ Скрылевъ
  • 16,187
  • 5
  • 56
  • 69