Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install pngquant-bin on Ubuntu 16.04 (WSL) #64

Open
xakep139 opened this issue May 24, 2017 · 14 comments
Open

Can't install pngquant-bin on Ubuntu 16.04 (WSL) #64

xakep139 opened this issue May 24, 2017 · 14 comments

Comments

@xakep139
Copy link

sudo npm install -g pngquant-bin@^3.0.0 output:

info lifecycle [email protected]~postinstall: [email protected]
verbose lifecycle [email protected]~postinstall: unsafe-perm in lifecycle false
verbose lifecycle [email protected]~postinstall: PATH: /usr/share/npm/bin/node-gyp-bin:/usr/local/lib/node_modules/pngquant-bin/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
verbose lifecycle [email protected]~postinstall: CWD: /usr/local/lib/node_modules/pngquant-bin
silly lifecycle [email protected]~postinstall: Args: [ '-c', 'node lib/install.js' ]
info lifecycle [email protected]~postinstall: Failed to exec postinstall script
verbose unlock done using /home/nikita/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
silly rollbackFailedOptional Starting
silly rollbackFailedOptional Finishing
silly runTopLevelLifecycles Starting
silly runTopLevelLifecycles Finishing
silly install printInstalled
verbose stack Error: [email protected] postinstall: `node lib/install.js`
verbose stack spawn ENOENT
verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:17:16)
verbose stack     at emitTwo (events.js:87:13)
verbose stack     at ChildProcess.emit (events.js:172:7)
verbose stack     at maybeClose (internal/child_process.js:821:16)
verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
verbose pkgid [email protected]
verbose cwd /home/nikita
error Linux 4.4.0-43-Microsoft
error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "pngquant-bin@^3.0.0"
error node v4.2.6
error npm  v3.5.2
error file sh
error code ELIFECYCLE
error errno ENOENT
error syscall spawn
error [email protected] postinstall: `node lib/install.js`
error spawn ENOENT
error Failed at the [email protected] postinstall script 'node lib/install.js'.
error Make sure you have the latest version of node.js and npm installed.
error If you do, this is most likely a problem with the pngquant-bin package,
error not with npm itself.
error Tell the author that this fails on your system:
error     node lib/install.js
error You can get information on how to open an issue for this project with:
error     npm bugs pngquant-bin
error Or if that isn't available, you can get their info via:
error     npm owner ls pngquant-bin
error There is likely additional logging output above.
verbose exit [ 1, true ]
@xakep139 xakep139 changed the title Can't install pngquant-bin on Ubuntu 16.04 Can't install pngquant-bin on Ubuntu 16.04 (WSL) May 24, 2017
@xakep139
Copy link
Author

libpng-dev is installed

@alekaizer
Copy link

Have the same issue,

@xakep139 have you found a work around ?

@xakep139
Copy link
Author

xakep139 commented Aug 2, 2017

@alekaizer, nope. I've decided to replace package with pngquant-bin dependency with similar package without it

@DKurilo
Copy link

DKurilo commented Oct 31, 2017

Type
sudo apt-get install nodejs-legacy
before
sudo npm install -g pngquant-bin

Further reading:
https://nodejs.org/en/download/package-manager/
A Node.js package is also available in the official repo for Debian Sid (unstable), Jessie (testing) and Wheezy (wheezy-backports) as "nodejs". It only installs a nodejs binary.
The nodejs-legacy package installs a node symlink that is needed by many modules to build and run correctly. The Node.js modules available in the distribution official repositories do not need it.

@mdaliyan
Copy link

same problem here on ubuntu 17.10

root@latitude a$ sudo npm install pngquant
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

> [email protected] postinstall /root/a/node_modules/pngquant-bin
> node lib/install.js

  ⚠ The `/root/a/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant built successfully
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 305 packages from 128 contributors in 37.183s
root@latitude a$ sudo npm install pngquant-bin
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

> [email protected] postinstall /root/a/node_modules/pngquant/node_modules/pngquant-bin
> node lib/install.js

  ⚠ The `/root/a/node_modules/pngquant/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant built successfully

> [email protected] postinstall /root/a/node_modules/pngquant-bin
> node lib/install.js

  ⚠ The `/root/a/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
  ✖ RequestError: pngquant failed to build, make sure that libpng-dev is installed
    at ClientRequest.req.once.err (/root/a/node_modules/got/index.js:111:21)
    at Object.onceWrapper (events.js:272:13)
    at ClientRequest.emit (events.js:180:13)
    at Socket.socketErrorListener (_http_client.js:394:9)
    at Socket.emit (events.js:180:13)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at process._tickCallback (internal/process/next_tick.js:114:19)
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

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!     /root/.npm/_logs/2018-03-16T08_18_52_426Z-debug.log

says make sure that libpng-dev is installed but the package is installed already

$ apt-get install libpng-dev 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libpng-dev is already the newest version (1.6.34-1).
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.

@anthonyaam
Copy link

@mdaliyan The above problem looks slightly different than yours. I think you're looking for issue 78.

@drzippie
Copy link

To build pngquant binary you need to have installed make.
apt-get install make
(or similar)
Found viewing 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()}"`

[..]

@mdaliyan
Copy link

It must be so @drzippie . I removed nodejs that was installed from repo and compiled it from source. Then I tried to install pngquant-bin, and it was installed without any problem.

@mehranabi
Copy link

Hello @mdaliyan , I had a similar problem and fixed by installing libpng-dev with this command:
sudo apt install libpng-dev

@gbryant200
Copy link

gbryant200 commented Mar 28, 2018

grep-status -FProvides,Package -sPackage,Provides,Status libpng-dev
Package: libpng12-dev
Provides: libpng-dev, libpng12-0-dev, libpng3-dev
Status: install ok installed

Still get:
pngquant pre-build test passed successfully
pngquant failed to build, make sure that libpng-dev is installed

[email protected]
node.js version v9.9.0
npm version 5.6.0
Ubuntu 16.04
make 4.1-6 installed

any ideas?

@remcohaszing
Copy link

After some debugging I found out that the error on my system (Ubuntu 18.04) was a permission error. My /tmp directory is mounted on a tmpfs. I was passing the noexec in my mount options in fstab, which resulted into ./configure (extracted into a temporary directory) was not executable.

If this is the case, remove noexec from the mount options in /etc/fstab. Then remount /tmp.

sudo mount -o rw,remount /tmp

I hope this helps!

@c2h2
Copy link

c2h2 commented May 15, 2018

tried: sudo apt-get install -y build-essential libpng-dev ?

@mehdilamaaffar
Copy link

@c2h2 thank you it worked ❤

@gihandilanka-github
Copy link

Hello @mdaliyan , thank you. It worked for me.
Ubuntu 18.04
Node v10.15.3
npm 6.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests