operating system ubuntu 17.10
node -v
output: v8.11.1
npm -v
output: 5.8.0
sudo apt-get install libpng-dev
output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpng-dev is already the newest version (1.6.34-1).
0 to upgrade, 0 to newly install, 0 to remove and 70 not to upgrade.
output from npm install
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[email protected] install /home/administrator/Documents/laravel/basicAdministration/node_modules/node-sass
node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.8.3/linux-x64-57_binding.node
Download complete ] - :
Binary saved to /home/administrator/Documents/laravel/basicAdministration/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /home/administrator/.npm/node-sass/4.8.3/linux-x64-57_binding.node
[email protected] postinstall /home/administrator/Documents/laravel/basicAdministration/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
node lib/post_install.js
[email protected] postinstall /home/administrator/Documents/laravel/basicAdministration/node_modules/node-sass
node scripts/build.js
Binary found at /home/administrator/Documents/laravel/basicAdministration/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
[email protected] postinstall /home/administrator/Documents/laravel/basicAdministration/node_modules/gifsicle
node lib/install.js
✔ gifsicle pre-build test passed successfully
[email protected] postinstall /home/administrator/Documents/laravel/basicAdministration/node_modules/mozjpeg
node lib/install.js
✔ mozjpeg pre-build test passed successfully
[email protected] postinstall /home/administrator/Documents/laravel/basicAdministration/node_modules/optipng-bin
node lib/install.js
✔ optipng pre-build test passed successfully
[email protected] postinstall /home/administrator/Documents/laravel/basicAdministration/node_modules/pngquant-bin
node lib/install.js
âš The /home/administrator/Documents/laravel/basicAdministration/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/administrator/Documents/laravel/basicAdministration/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node lib/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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/administrator/.npm/_logs/2018-04-20T08_27_55_321Z-debug.log
finally got it to install, think it was all the compiling software, gcc, make etc
@webciter if you no longer have any issues, perhaps close this so the maintainers save some time? :)
@webciter How did you fix this?
I have exact same issue
@Intelioum
Issue
I had a same issue when doing npm install or yarn install.
The issue occurred to me was install process failure by compiling source code as follows.
${project}/node_modules/img-loader/node_modules/pngquant-bin/lib/install.js
binBuild.url('http://pngquant.org/pngquant-2.10.1-src.tar.gz', [
'rm ./INSTALL',
`./configure --prefix="${bin.dest()}"`,
`make install BINPREFIX="${bin.dest()}"`
])
Solution
Make sure these libraries are installed on your OS.
I confirmed this solution worked on Centos7.3 and alpine on docker.
Centos
yum install -y gcc make libpng-devel
Alpine
apk add --no-cache bash libpng-dev gcc make musl-dev
@zizu21105 thanks!! This fixed it for me on CentOS 7!
for windows, users just use npm cache clean command and after that npm install -g gulp-cli
this work for me
I ran into the same issue deploying a new Laravel 5.6 application to a newly provisioned Forge server (Ubuntu 18.04.1)
Installing libpng-dev via sudo apt-get install libpng-dev sorted this for me.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
@Intelioum
Issue
I had a same issue when doing
npm installoryarn install.The issue occurred to me was install process failure by compiling source code as follows.
${project}/node_modules/img-loader/node_modules/pngquant-bin/lib/install.jsSolution
Make sure these libraries are installed on your OS.
I confirmed this solution worked on Centos7.3 and alpine on docker.
Centos
Alpine