Code Monkey home page Code Monkey logo

optipng-bin's Introduction

optipng-bin test

OptiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information

You probably want imagemin-optipng instead.

Install

npm install --save optipng-bin

Usage

import {execFile} from 'node:child_process';
import optipng from 'optipng-bin';

execFile(optipng, ['-out', 'output.png', 'input.png'], error => {
	console.log('Image minified!');
});

CLI

npm install --global optipng-bin
optipng --help

optipng-bin's People

Contributors

1000ch avatar addyosmani avatar bigmichi1 avatar evilebottnawi avatar farcop avatar jorrit avatar kevva avatar kontinuation avatar mnpenner avatar nervo avatar passy avatar sergeylukin avatar shinnn avatar sindresorhus avatar socketwiz avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

optipng-bin's Issues

install failing at check.js

I was originally trying to install imagemin but it failed because of this module, so tried this one alone... sadface!

[email protected] postinstall D:\Perforce\1826\tjacques_MTL-
in
node lib/check.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT
at errnoException (net.js:904:11)
at Object.afterConnect as oncomplete
npm ERR! [email protected] postinstall: node lib/check.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.

Incapable of using imagemin on png

node : v4.2.2
npm : 3.3.12
optipng-bin : 3.0.2

Running from latest grunt-contrib-imagemin
Get this error on imagemin.run

Warning: Error: spawn -some-project-root-/node_modules/optipng-bin/vendor/optipng ENOENT in file -some-project-root-/images/address.png Use --force to continue.

npm install optipng-bin error on windows

running

> npm install optipng-bin
npm http GET http://registry.npmjs.org/optipng-bin
npm http 200 http://registry.npmjs.org/optipng-bin
.
.
.
.

> [email protected] postinstall D:\temp\node_modules\optipng-bin
> node pre-build.js


stream.js:81
      throw er; // Unhandled stream error in pipe.
            ^
Error: getaddrinfo ENOTFOUND
    at errnoException (dns.js:37:11)
    at Object.onanswer [as oncomplete] (dns.js:124:16)
npm ERR! [email protected] postinstall: `node pre-build.js`
npm ERR! `cmd "/c" "node pre-build.js"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the optipng-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node pre-build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls optipng-bin
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 5.2.3790
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "optipng-bin"
npm ERR! cwd D:\temp
npm ERR! node -v v0.8.20
npm ERR! npm -v 1.2.11
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\temp\npm-debug.log
npm ERR! not ok code 0

Cannot Initialize?

Fairly new to imagemin, using it with Gulp. Got error below.
#57 I reinstalled all my app's dependencies again. Still running into same error.

Node: 4.2.1
npm: 2.14.7

Running inside Vagrant, used command "npm run gulp". Did not include imagemin-pngquant as per example in npm.

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: Command failed: /home/vagrant/local/venvy-eva/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng -strip all -clobber -force -fix -o 2 -out /home/vagrant/local/venvy-eva/ab2ac3e6-3114-41e9-8dbc-b41f3d54a41f /home/vagrant/local/venvy-eva/004dcf3e-f290-43be-908e-85dfec1d53b5
/home/vagrant/local/venvy-eva/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng: 6: /home/vagrant/local/venvy-eva/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng: Syntax error: newline unexpected

    at ChildProcess.exithandler (child_process.js:203:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

npm install - can't compile from source

Hello. I try to install dependencies in my project, but npm can't install optipng 0.7.5.
What I should do?
Thanks in advance.

$ npm install

[email protected] postinstall /home/user/work/node_modules/optipng-bin
node lib/install.js

⚠ /home/user/work/node_modules/optipng-bin/vendor/optipng 0.6.4 does not satisfy the version requirement of >=0.7.5
⚠ optipng pre-build test failed
ℹ compiling from source
✖ Error: Command failed:
at ChildProcess.exithandler (child_process.js:648:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Socket. (child_process.js:969:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)

Error thrown on some systems

When I attempt to use "imagemin" task through yeoman build, it suspiciously throws an error with:

Fatal error: ENOENT, no such file or directory '[my output path].png'

I say suspicious because it shouldn't be checking my output path (which hasn't completed yet) in order to do the image compression.

Drilling down into the dependencies, I discovered on the systems that work, I can execute optipng fine. The ones that don't, throw a different error: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory. Some googling reveals this has to do with using 32 vs 64 bit version of glibc.

Wondering if someone knows what the issue is - is it necessary to package both 32 bit and 64 bit compiled versions?

Update node modules

If you run npm outdated you will see you have quite a lot of outdated modules. Would be good to update them soon. Thx.

spiegepngrtran.c:98: warning: ‘png_rtran_ok’l.de when building

When I try to install optipng-bin (via grunt-contrib-imagemin 0.3.0) I get the following build error for optipng:

> [email protected] postinstall /home/layout/nord-relaunch/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin
> node index.js

✗ pre-build test failed, compiling from source...
✓ pngquant rebuilt successfully

> [email protected] postinstall /home/layout/nord-relaunch/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin
> node index.js

⚠ pre-build test failed, compiling from source...
✖ { [Error: Command failed: pngrtran.c:98: warning: ‘png_rtran_ok’ defined but not used
pngxmem.c: In function ‘pngx_malloc_rows_extended’:
pngxmem.c:37: warning: comparison is always false due to limited range of data type
ratio.c:25: error: conflicting types for ‘opng_longest_impl_t’
ratio.c:24: error: previous declaration of ‘opng_longest_impl_t’ was here
ratio.c:76: error: expected declaration specifiers or ‘...’ before ‘opng_ulongest_impl_t’
ratio.c:76: error: expected declaration specifiers or ‘...’ before ‘opng_ulongest_impl_t’
ratio.c: In function ‘opng_sprint_uratio_impl’:
ratio.c:90: error: ‘opng_ulongest_impl_t’ undeclared (first use in this function)
ratio.c:90: error: (Each undeclared identifier is reported only once
ratio.c:90: error: for each function it appears in.)
ratio.c:90: error: expected ‘;’ before ‘integer_part’
ratio.c:95: error: ‘denom’ undeclared (first use in this function)
ratio.c:97: error: ‘num’ undeclared (first use in this function)
ratio.c:117: error: ‘integer_part’ undeclared (first use in this function)
ratio.c:118: error: ‘remainder’ undeclared (first use in this function)
ratio.c: In function ‘opng_ulratio_to_factor_string’:
ratio.c:158: error: ‘opng_ulongest_impl_t’ undeclared (first use in this function)
ratio.c:158: error: expected ‘;’ before ‘num’
ratio.c:159: error: expected ‘;’ before ‘denom’
ratio.c:160: error: ‘num’ undeclared (first use in this function)
ratio.c:160: error: ‘denom’ undeclared (first use in this function)
ratio.c:160: error: too many arguments to function ‘opng_sprint_uratio_impl’
ratio.c:156: warning: unused parameter ‘ratio’
ratio.c: In function ‘opng_ulratio_to_percent_string’:
ratio.c:170: error: ‘opng_ulongest_impl_t’ undeclared (first use in this function)
ratio.c:170: error: expected ‘;’ before ‘num’
ratio.c:171: error: expected ‘;’ before ‘denom’
ratio.c:172: error: ‘num’ undeclared (first use in this function)
ratio.c:172: error: ‘denom’ undeclared (first use in this function)
ratio.c:172: error: too many arguments to function ‘opng_sprint_uratio_impl’
ratio.c:168: warning: unused parameter ‘ratio’
make[1]: *** [ratio.o] Error 1
make: *** [install] Error 2
] killed: false, code: 2, signal: null }
✔︎ optipng built successfully!

The system of the build-server is red hat linux 5.9.

Mac OS 10.9 optipng cannot execute binary file

After upgrading grunt-contrib-imagemin to 0.7.0 today I can't run my imagemin tasks on OSX, Ubuntu works just fine.

I noticed in the package.json for imagemin-optipng it references:

"optipng-bin": "^0.3.3",

As a dependency when the project seems to be named node-optipng-bin now, related?

Heres the error (true root path swapped with /path/to)

Warning: Command failed: /path/to/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng: /path/to/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng: cannot execute binary file

Does not assert optipng 0.7 is being used

The README advertises this as a wrapper around 0.7, is this supposed to be a guarantee? If so, when BinWrapper discovers optipng is already installed on the system, this package doesn't verify that the discovered version is, in fact, 0.7.

This causes issues in grunt-contrib-imagemin, for instance, which uses the -strip flag that only appeared in 0.7; if the host system includes 0.6, as an example, optipng fails silently.

If possible, it would be helpful if the package could use BinWrapper in a way that would verify the discovered system binary was 0.7, and download the vendor version if not.

Failed to npm install if `vendor/optipng` doesn't exist yet.

$ git clean -xf; npm i

Removing vendor/optipng

> [email protected] postinstall /home/open/code/node-optipng-bin
> node index.js


/home/open/code/node-optipng-bin/node_modules/bin-wrapper/index.js:145
                    if (msg.indexOf(self.opts.version) !== -1) {
                            ^
TypeError: Cannot call method 'indexOf' of undefined
    at /home/open/code/node-optipng-bin/node_modules/bin-wrapper/index.js:145:29
    at ChildProcess.<anonymous> (/home/open/code/node-optipng-bin/node_modules/bin-check/index.js:46:24)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at Process.ChildProcess._handle.onexit (child_process.js:797:12)

npm ERR! [email protected] postinstall: `node index.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the optipng-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls optipng-bin
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-19-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "i"
npm ERR! cwd /home/open/code/node-optipng-bin
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/open/code/node-optipng-bin/npm-debug.log
npm ERR! not ok code 0

Post yo angular generation failures

Hi,

I'm having trouble using yeoman to generate an angular application.

Yeoman appears to be doing its part fine, but when it comes to bower install && npm install, it fails when running the OptiPNG tests.

I'm running OSX 10.8.3, Node version 0.8.18, and the latest versions of NPM and yeoman.

[1:35:14] Keva161:yo angular
Would you like to include Twitter Bootstrap? (Y/n) n
If so, would you like to use Twitter Bootstrap for Compass (as opposed to vanilla CSS)? (Y/n) n
Would you like to include angular-resource.js? (Y/n) n
Would you like to include angular-cookies.js? (Y/n) n
Would you like to include angular-sanitize.js? (Y/n) n
   create app/index.html
   create component.json
   create package.json
   create Gruntfile.js
   invoke   angular:common:/Users/Keva161/.nvm/v0.8.18/lib/node_modules/generator-angular/app/index.js
   create     .bowerrc
   create     .editorconfig
   create     .gitattributes
   create     .jshintrc
   create     app/.buildignore
   create     app/.htaccess
   create     app/404.html
   create     app/favicon.ico
   create     app/robots.txt
   create     app/styles/main.css
   create     app/views/main.html
   create     test/runner.html
   create     .gitignore
   invoke   angular:main:/Users/Keva161/.nvm/v0.8.18/lib/node_modules/generator-angular/app/index.js
   create     app/scripts/app.js
   invoke   angular:controller:/Users/Keva161/.nvm/v0.8.18/lib/node_modules/generator-angular/app/index.js
   create     app/scripts/controllers/main.js
   create     test/spec/controllers/main.js
   invoke   karma:app
If you have not already, install the "grunt-karma" plugin for grunt:
  npm install --save grunt-karma
   create     karma-e2e.conf.js
   create     karma.conf.js


I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.


npm WARN package.json [email protected] No readme data!
npm http GET https://registry.npmjs.org/grunt-contrib-copy
npm http GET https://registry.npmjs.org/grunt-contrib-uglify
npm http GET https://registry.npmjs.org/grunt-contrib-connect
npm http GET https://registry.npmjs.org/grunt-contrib-coffee
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/grunt-contrib-clean
npm http bower warn Using deprecated "component.json". Please use "bower.json" instead
GET https://registry.npmjs.org/grunt-contrib-concat
npm http GET https://registry.npmjs.org/grunt-contrib-imagemin
npm http GET https://registry.npmjs.org/grunt-bower-requirejs
npm http GET https://registry.npmjs.org/grunt-contrib-jshint
npm http GET https://registry.npmjs.org/grunt-rev
npm http GET https://registry.npmjs.org/grunt-usemin
npm http GET https://registry.npmjs.org/grunt-karma
npm http GET https://registry.npmjs.org/grunt-contrib-htmlmin
npm http GET https://registry.npmjs.org/grunt-open
npm http GET https://registry.npmjs.org/matchdep
npm http GET https://registry.npmjs.org/grunt-google-cdn
npm http GET https://registry.npmjs.org/grunt-contrib-compass
npm http GET https://registry.npmjs.org/grunt-ngmin
npm http GET https://registry.npmjs.org/grunt-regarde
bower cloning git://github.com/bestiejs/json3.git
bower cached git://github.com/bestiejs/json3.git
bower fetching json3
bower cloning git://github.com/angular/bower-angular-scenario.git
bower cached git://github.com/angular/bower-angular-scenario.git
bower fetching angular-scenario
npm http GET https://registry.npmjs.org/grunt-contrib-cssmin
npm http GET https://registry.npmjs.org/grunt-contrib-livereload
bower cloning git://github.com/kriskowal/es5-shim
bower cached git://github.com/kriskowal/es5-shim
bower fetching es5-shim
bower cloning git://github.com/angular/bower-angular-mocks.git
bower cached git://github.com/angular/bower-angular-mocks.git
bower fetching angular-mocks
bower cloning git://github.com/angular/bower-angular.git
bower cached git://github.com/angular/bower-angular.git
bower fetching angular
bower checking out angular-scenario#v1.0.6
bower copying /Users/Keva161/.bower/cache/angular-scenario/b14760da33b10f217074c8db0293d643
bower checking out angular-mocks#v1.0.6
bower copying /Users/Keva161/.bower/cache/angular-mocks/e9f8053314f992cbc734f1d338e7339c
bower checking out json3#v3.2.4
npm http 304 https://registry.npmjs.org/grunt-contrib-uglify
npm http 304 https://registry.npmjs.org/grunt-contrib-coffee
npm http 304 https://registry.npmjs.org/grunt-contrib-connect
npm http 304 https://registry.npmjs.org/grunt-contrib-copy
bower copying /Users/Keva161/.bower/cache/json3/5b1ce4d7f2e8368c9df0c4e49d95b130
npm http 304 https://registry.npmjs.org/grunt
bower checking out angular#v1.0.6
npm http 304 https://registry.npmjs.org/grunt-contrib-clean
npm http 304 https://registry.npmjs.org/grunt-contrib-concat
bower copying /Users/Keva161/.bower/cache/angular/ef2188def21eb1bbd1f1792311942a53
npm http 304 https://registry.npmjs.org/grunt-contrib-imagemin
bower checking out es5-shim#v2.0.8
npm http 304 https://registry.npmjs.org/grunt-bower-requirejs
npm http 304 https://registry.npmjs.org/grunt-contrib-jshint
npm WARN package.json [email protected] No readme data!
bower copying /Users/Keva161/.bower/cache/es5-shim/657e4a25e23273fe20674055f8eea8e5
npm http 304 https://registry.npmjs.org/grunt-rev
npm http 304 https://registry.npmjs.org/grunt-usemin
npm http 304 https://registry.npmjs.org/grunt-karma
npm http 304 https://registry.npmjs.org/grunt-contrib-htmlmin
npm http 304 https://registry.npmjs.org/grunt-open
npm WARN package.json [email protected] No readme data!
npm http 304 https://registry.npmjs.org/matchdep
npm http 304 https://registry.npmjs.org/grunt-google-cdn
npm http 304 https://registry.npmjs.org/grunt-contrib-compass
npm http 304 https://registry.npmjs.org/grunt-ngmin
npm http 304 https://registry.npmjs.org/grunt-regarde
npm http 304 https://registry.npmjs.org/grunt-contrib-cssmin
npm http 304 https://registry.npmjs.org/grunt-contrib-livereload
npm WARN package.json [email protected] No readme data!
bower cloning git://github.com/angular/bower-angular.git
bower cached git://github.com/angular/bower-angular.git
bower fetching angular
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/requirejs
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/filesize
npm http GET https://registry.npmjs.org/grunt-lib-contrib
npm http GET https://registry.npmjs.org/ngmin
npm http GET https://registry.npmjs.org/tmp/0.0.16
npm http GET https://registry.npmjs.org/grunt-lib-contrib
npm http GET https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/html-minifier
npm http GET https://registry.npmjs.org/tiny-lr
npm http GET https://registry.npmjs.org/optipng-bin
npm http GET https://registry.npmjs.org/jpegtran-bin
npm http GET https://registry.npmjs.org/karma
npm http GET https://registry.npmjs.org/gaze
npm http GET https://registry.npmjs.org/grunt-lib-contrib
npm http GET https://registry.npmjs.org/jshint
npm http GET https://registry.npmjs.org/open/0.0.2
npm http GET https://registry.npmjs.org/clean-css
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/uglify-js
npm http GET https://registry.npmjs.org/coffee-script
bower checking out angular#v1.0.6
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http GET https://registry.npmjs.org/findup-sync
bower copying /Users/Keva161/.bower/cache/angular/ef2188def21eb1bbd1f1792311942a53
npm http GET https://registry.npmjs.org/eventemitter2
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/hooker
npm http GET https://registry.npmjs.org/iconv-lite
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/underscore.string
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/js-yaml
npm http GET https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/nopt
bower installing angular#1.0.6
bower installing es5-shim#2.0.8
bower installing json3#3.2.4
bower installing angular-scenario#1.0.6
bower installing angular-mocks#1.0.6
npm http 304 https://registry.npmjs.org/requirejs
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/filesize
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/grunt-lib-contrib
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/ngmin
npm http 304 https://registry.npmjs.org/tmp/0.0.16
npm http 304 https://registry.npmjs.org/grunt-lib-contrib
npm http 304 https://registry.npmjs.org/connect
npm http 304 https://registry.npmjs.org/html-minifier
npm http GET https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/escodegen
npm http GET https://registry.npmjs.org/clone
npm http 304 https://registry.npmjs.org/tiny-lr
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/zlib-browserify/0.0.1
npm http 304 https://registry.npmjs.org/optipng-bin
npm http 304 https://registry.npmjs.org/jpegtran-bin
npm http 304 https://registry.npmjs.org/karma
npm http 304 https://registry.npmjs.org/gaze
npm http 304 https://registry.npmjs.org/grunt-lib-contrib
npm http 304 https://registry.npmjs.org/jshint
npm http 304 https://registry.npmjs.org/open/0.0.2
npm http 304 https://registry.npmjs.org/clean-css
npm http 304 https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/uglify-js
npm http 304 https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http 304 https://registry.npmjs.org/findup-sync
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/eventemitter2
npm http 304 https://registry.npmjs.org/hooker
npm http 304 https://registry.npmjs.org/iconv-lite
npm http 304 https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/faye-websocket
npm http GET https://registry.npmjs.org/noptify
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/fileset
npm http 304 https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/escodegen
npm http 304 https://registry.npmjs.org/clone
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/zlib-browserify/0.0.1
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/faye-websocket
npm http 304 https://registry.npmjs.org/noptify
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/fileset
npm http 304 https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/formidable/1.0.13
npm http GET https://registry.npmjs.org/buffer-crc32/0.2.1
npm http GET https://registry.npmjs.org/bytes/0.2.0
npm http GET https://registry.npmjs.org/qs/0.6.3
npm http GET https://registry.npmjs.org/cookie/0.0.5
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/pause/0.0.1
npm http GET https://registry.npmjs.org/fresh/0.1.0
npm http GET https://registry.npmjs.org/send/0.1.0
npm http GET https://registry.npmjs.org/cookie-signature/1.0.1
npm http GET https://registry.npmjs.org/estraverse
npm http GET https://registry.npmjs.org/source-map
npm http GET https://registry.npmjs.org/source-map
npm http GET https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/mocha
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/buffer-crc32/0.2.1
npm http 304 https://registry.npmjs.org/bytes/0.2.0
npm http 304 https://registry.npmjs.org/qs/0.6.3
npm http 304 https://registry.npmjs.org/cookie/0.0.5
npm http 304 https://registry.npmjs.org/formidable/1.0.13
npm http 304 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/chokidar
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/optimist/0.3.5
npm http GET https://registry.npmjs.org/xmlbuilder/0.4.2
npm http GET https://registry.npmjs.org/LiveScript/1.0.1
npm http GET https://registry.npmjs.org/istanbul/0.1.22
npm http GET https://registry.npmjs.org/growly
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/http-proxy
npm http GET https://registry.npmjs.org/log4js
npm http 304 https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/fresh/0.1.0
npm http 304 https://registry.npmjs.org/send/0.1.0
npm http 304 https://registry.npmjs.org/cookie-signature/1.0.1
npm http GET https://registry.npmjs.org/q
npm http 304 https://registry.npmjs.org/estraverse
npm http 304 https://registry.npmjs.org/source-map
npm http 304 https://registry.npmjs.org/source-map
npm http 304 https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/mocha
npm http 304 https://registry.npmjs.org/chokidar
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/optimist/0.3.5
npm http 304 https://registry.npmjs.org/xmlbuilder/0.4.2
npm http 304 https://registry.npmjs.org/LiveScript/1.0.1
npm http 304 https://registry.npmjs.org/istanbul/0.1.22
npm http 304 https://registry.npmjs.org/growly
npm http 304 https://registry.npmjs.org/colors/0.6.0-1
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/http-proxy
npm http 304 https://registry.npmjs.org/log4js
npm http 304 https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/mime/1.2.6
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/promptly
npm http GET https://registry.npmjs.org/rc
npm http GET https://registry.npmjs.org/hogan.js
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/stable
npm http GET https://registry.npmjs.org/tmp
npm http GET https://registry.npmjs.org/update-notifier
npm http GET https://registry.npmjs.org/unzip/0.1.7
npm http GET https://registry.npmjs.org/archy
npm http GET https://registry.npmjs.org/read-package-json
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/mime/1.2.6
npm http 304 https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/block-stream
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/amdefine
npm http 304 https://registry.npmjs.org/hogan.js
npm http 304 https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/socket.io-client/0.9.11
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/stable
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/tmp
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/aws-sign
npm http 304 https://registry.npmjs.org/update-notifier
npm http 304 https://registry.npmjs.org/unzip/0.1.7
npm http 304 https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/read-package-json
npm http 304 https://registry.npmjs.org/archy
npm http GET https://registry.npmjs.org/prelude-ls
npm http GET https://registry.npmjs.org/async/0.1.15
npm http GET https://registry.npmjs.org/dequeue/1.0.3
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/readable-stream
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/diff/1.0.2
npm http GET https://registry.npmjs.org/growl
npm http GET https://registry.npmjs.org/jade/0.26.3
npm http GET https://registry.npmjs.org/ms/0.3.0
npm http GET https://registry.npmjs.org/mkdirp/0.3.3
npm http 304 https://registry.npmjs.org/promptly
npm http 304 https://registry.npmjs.org/rc
npm http 304 https://registry.npmjs.org/amdefine
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.11
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/hawk
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/cookie-jar
npm http 304 https://registry.npmjs.org/aws-sign
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/prelude-ls
npm http 304 https://registry.npmjs.org/dequeue/1.0.3
npm http 304 https://registry.npmjs.org/async/0.1.15
npm WARN package.json [email protected] No readme data!
npm WARN package.json [email protected] No readme data!
npm http 304 https://registry.npmjs.org/readable-stream
npm WARN package.json [email protected] No readme data!
npm WARN package.json [email protected] No readme data!
npm WARN package.json [email protected] No readme data!
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm http 304 https://registry.npmjs.org/diff/1.0.2
npm http 304 https://registry.npmjs.org/growl
npm http 304 https://registry.npmjs.org/jade/0.26.3
npm http 304 https://registry.npmjs.org/ms/0.3.0
npm http 304 https://registry.npmjs.org/mkdirp/0.3.3
npm WARN package.json [email protected] No readme data!
npm http GET https://registry.npmjs.org/configstore
npm http GET https://registry.npmjs.org/read
npm http GET https://registry.npmjs.org/slide
npm http GET https://registry.npmjs.org/config-chain
npm http GET https://registry.npmjs.org/npmlog
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/setimmediate
npm http GET https://registry.npmjs.org/match-stream/0.0.1
npm http GET https://registry.npmjs.org/binary
npm http GET https://registry.npmjs.org/pullstream
npm http GET https://registry.npmjs.org/handlebars
npm http GET https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/read
npm http 304 https://registry.npmjs.org/config-chain
npm http 304 https://registry.npmjs.org/npmlog
npm http 304 https://registry.npmjs.org/slide
npm http 304 https://registry.npmjs.org/configstore
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/pullstream
npm http 304 https://registry.npmjs.org/binary
npm http 304 https://registry.npmjs.org/match-stream/0.0.1
npm http 304 https://registry.npmjs.org/setimmediate
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/handlebars
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://github.com/ariya/esprima/tarball/master
npm http GET https://registry.npmjs.org/peakle
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm http GET https://registry.npmjs.org/shelljs
npm http GET https://registry.npmjs.org/cli
npm http GET https://registry.npmjs.org/proto-list
npm http GET https://registry.npmjs.org/ansi
npm http GET https://registry.npmjs.org/yamljs
npm http GET https://registry.npmjs.org/mute-stream
npm http GET https://registry.npmjs.org/ini
npm http 304 https://registry.npmjs.org/shelljs
npm http 304 https://registry.npmjs.org/mkdirp/0.3.0
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/peakle
npm http 304 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/buffers
npm http 304 https://registry.npmjs.org/cli
npm http 304 https://registry.npmjs.org/proto-list
npm http 304 https://registry.npmjs.org/ansi
npm http 304 https://registry.npmjs.org/yamljs
npm http 304 https://registry.npmjs.org/mute-stream
npm http GET https://registry.npmjs.org/slice-stream/0.0.0
npm http GET https://registry.npmjs.org/over
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http GET https://registry.npmjs.org/chainsaw
npm http 304 https://registry.npmjs.org/ini
npm http 304 https://registry.npmjs.org/buffers
npm http GET https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/estraverse
npm http GET https://registry.npmjs.org/source-map
npm http 304 https://registry.npmjs.org/chainsaw
npm http GET https://registry.npmjs.org/uglify-js
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/utile
npm http 200 https://github.com/ariya/esprima/tarball/master
npm http 304 https://registry.npmjs.org/estraverse
npm http 304 https://registry.npmjs.org/source-map
npm http 304 https://registry.npmjs.org/uglify-js
npm http GET https://registry.npmjs.org/traverse
npm http 304 https://registry.npmjs.org/pkginfo
npm http 304 https://registry.npmjs.org/slice-stream/0.0.0
npm http 304 https://registry.npmjs.org/over
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/utile
npm http 304 https://registry.npmjs.org/traverse
npm http 304 https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/underscore.string
npm http GET https://registry.npmjs.org/i
npm http GET https://registry.npmjs.org/deep-equal
npm http GET https://registry.npmjs.org/ncp

> [email protected] postinstall /Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin
> node pre-build.js


> [email protected] postinstall /Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin
> node pre-build.js

npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/uglify-js/1.2.5

  ✖ 4 of 3 tests failed:

  1) OptiPNG should return path to OptiPNG binary:

  AssertionError: false == true
      at args (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/test/test-optipng-path.js:18:4)
      at ChildProcess.exithandler (child_process.js:544:7)
      at ChildProcess.EventEmitter.emit (events.js:99:17)
      at maybeClose (child_process.js:638:16)
      at Process._handle.onexit (child_process.js:680:5)

  2) OptiPNG should successfully proxy OptiPNG:

  AssertionError: false == true
      at args (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/test/test-optipng-path.js:27:4)
      at ChildProcess.exithandler (child_process.js:544:7)
      at ChildProcess.EventEmitter.emit (events.js:99:17)
      at maybeClose (child_process.js:638:16)
      at Process._handle.onexit (child_process.js:680:5)

  3) OptiPNG should minify a .png:
     Error: ENOENT, no such file or directory 'test/minified.png'
      at Object.fs.statSync (fs.js:524:18)
      at /Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/test/test-optipng-path.js:43:20
      at ChildProcess.exithandler (child_process.js:544:7)
      at ChildProcess.EventEmitter.emit (events.js:99:17)
      at maybeClose (child_process.js:638:16)
      at Socket.ChildProcess.spawn.stdin (child_process.js:815:11)
      at Socket.EventEmitter.emit (events.js:96:17)
      at Socket._destroy.destroyed (net.js:358:10)
      at process.startup.processNextTick.process._tickCallback (node.js:244:9)

  4) OptiPNG "after all" hook:
     Error: ENOENT, no such file or directory 'test/minified.png'
      at Object.fs.unlinkSync (fs.js:582:18)
      at Context.binPath (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/test/test-optipng-path.js:11:6)
      at Hook.Runnable.run (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/mocha/lib/runnable.js:213:32)
      at next (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/mocha/lib/runner.js:243:10)
      at Runner.hook (/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/mocha/lib/runner.js:254:5)
      at process.startup.processNextTick.process._tickCallback (node.js:244:9)


pre-build test failed, compiling from source...
Fetching http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.4/optipng-0.7.4.tar.gz...

  3 tests complete (232 ms)

pre-build test passed successfully, skipping build...
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/ncp
npm http 304 https://registry.npmjs.org/i
npm http 304 https://registry.npmjs.org/deep-equal
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm WARN prefer global [email protected] should be installed with -g
npm http 304 https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/sigmund

> [email protected] install /Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-karma/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/inherits
Done in /var/folders/jn/g1mkc1bx7090cm6269r6sbm40000gp/T/optipng-0.7.4

Building OptiPNG...

/Users/Keva161/Documents/Web Dev/Webapps/Angular/yo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/build.js:64
                            throw err;
                                  ^
Error: Command failed:
    at ChildProcess.exithandler (child_process.js:540:15)
    at ChildProcess.EventEmitter.emit (events.js:99:17)
    at maybeClose (child_process.js:638:16)
    at Socket.ChildProcess.spawn.stdin (child_process.js:815:11)
    at Socket.EventEmitter.emit (events.js:96:17)
    at Socket._destroy.destroyed (net.js:358:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
npm ERR! weird error 1
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node: Finished
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished
npm ERR! not ok code 0

fails inside a docker container

fails inside a docker container created from node:latest

root@d06adbb5fa5c:/home/app# gulp imagemin
[07:45:43] Using gulpfile /home/app/gulpfile.js
[07:45:43] Starting 'imagemin'...

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: Command failed: /home/app/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng -strip all -clobber -force -fix -o 2 -out /tmp/d3fd1a87-7e45-4d50-bf61-30c1c6911a31 /tmp/4a577168-c7f5-4eac-8fc8-44944cee6894
/home/app/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng: 6: /home/app/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng: Syntax error: newline unexpected

    at ChildProcess.exithandler (child_process.js:751:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Socket.<anonymous> (child_process.js:1183:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:485:12)

Can't compile in directories with spaces in the name

Trying to install this via jenkins in a job that had spaces in the name (QA Tools):

⚠ pre-build test failed, compiling from source...
✖ { [Error: Command failed: pngrtran.c:97:1: warning: ‘png_rtran_ok’ defined but not used [-Wunused-function]
pngxmem.c: In function ‘pngx_malloc_rows_extended’:
pngxmem.c:37:4: warning: comparison is always false due to limited range of data type [-Wtype-limits]
rm: cannot remove `/var/lib/jenkins/workspace/QA': Is a directory
rm: cannot remove `Tools': Is a directory
make[1]: [install] Error 1 (ignored)
rm: cannot remove `/var/lib/jenkins/workspace/QA': Is a directory
rm: cannot remove `Tools': Is a directory
make[1]: [install] Error 1 (ignored)
cp: omitting directory `/var/lib/jenkins/workspace/QA'
cp: omitting directory `Tools'
make[1]: *** [install] Error 1
make: *** [install] Error 2
] killed: false, code: 2, signal: null }

Fails in docker Container

Referencing #57.

This still seems to have a problem inside a Docker container. I'm running a debian docker container with the polymer starter kit which uses the gulp-imagemin plugin. This seems to fail with this output:

Unhandled rejection Error: Command failed: /opt/rift/node_modules/gulp-
imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-
bin/vendor/optipng -strip all -clobber -force -fix -o 2 -out /tmp/06bbcf19-f1ad-454f-bd52-
7acad3cd4a94 /tmp/4b6a19b5-9f49-47ec-a120-aee0634017dd
/opt/rift/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-
optipng/node_modules/optipng-bin/vendor/optipng: 6: /opt/rift/node_modules/gulp-
imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-
bin/vendor/optipng: Syntax error: newline unexpected

The various solutions pointed out in #57 seems to not fix the problem.

Cannot find module `rimraf`

When installing optipng-bin from the package.json, as in npm install I get this error message:

module.js:340
    throw err;
          ^
Error: Cannot find module 'rimraf'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/jakechampion/Projects/packer-cosmos/kaleidoscope/node_modules/optipng-bin/node_modules/bin-wrapper/bin-wrapper.js:13:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
npm ERR! [email protected] postinstall: `node lib/check.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the optipng-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node lib/check.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls optipng-bin
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/jakechampion/Projects/packer-cosmos/kaleidoscope
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.26
npm ERR! code ELIFECYCLE

However if I install the module manually, as in npm install optipng-bin it installs fine.

I am running OSX 10.8.5.

Here is the output from the command specified in the contributing.md file:
command: yo --version && echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)' && cat Gruntfile.js

output:

1.1.2
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
darwin { http_parser: '1.0',
  node: '0.10.25',
  v8: '3.14.5.9',
  ares: '1.9.0-DEV',
  uv: '0.10.23',
  zlib: '1.2.3',
  modules: '11',
  openssl: '1.0.1e' }
/*global module:false*/
"use strict";
module.exports = function(grunt) {

    grunt.initConfig({
        pkg         : grunt.file.readJSON('package.json'),
        jshint      : {
            all     : [ '**/*.js', '!node_modules/**/*', '!vendor/**/*' ],
            options : {
                jshintrc : '.jshintrc'
            }
        },
        nodeunit    : {
            all : ['tests/unit/**/*_test.js']
        },
        jscs        : {
            main    : [ '**/*.js', '!node_modules/**/*', '!vendor/**/*' ],
            options : {
                config : '.jscs.json',
            }
        },
        cssUrlEmbed : {
            encode : {
                expand : true,
                cwd    : 'fonts',
                src    : [ '**/*.css' ],
                dest   : 'public/stylesheets'
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-nodeunit');
    grunt.loadNpmTasks('grunt-css-url-embed');
    grunt.loadNpmTasks("grunt-jscs-checker");

    grunt.registerTask('default', ['jshint', 'jscs', 'nodeunit']);

    grunt.registerTask('fonts', ['cssUrlEmbed']);

};

The version I have specified in my package.json is "optipng-bin": "~0.3.1",`

npm install fails on OS X

I encountered an error while trying to install this as part of grunt-contrib. I was installing that to follow a tutorial about how to use grunt to build a JS app, so I have very little background knowledge of grunt, npm, node, etc. I will be happy to help you debug this but I'll need pretty specific instructions to get past my ignorance.
Trying to install on OS X 10.7.5 gets this error (paths sanitized a bit)

npm install optipng-bin
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/optipng-bin
npm http 304 https://registry.npmjs.org/optipng-bin
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/mocha
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/mocha
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/diff/1.0.2
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/growl
npm http GET https://registry.npmjs.org/jade/0.26.3
npm http GET https://registry.npmjs.org/mkdirp/0.3.3
npm http GET https://registry.npmjs.org/ms/0.3.0
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/diff/1.0.2
npm http 304 https://registry.npmjs.org/growl
npm http 304 https://registry.npmjs.org/jade/0.26.3
npm http 304 https://registry.npmjs.org/mkdirp/0.3.3
npm http 304 https://registry.npmjs.org/ms/0.3.0
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm http 304 https://registry.npmjs.org/mkdirp/0.3.0

[email protected] postinstall /Users/XXXXX/cliproto/node_modules/optipng-bin
node pre-build.js

module.js:340
throw err;
^
Error: Cannot find module './build.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/XXXXX/cliproto/node_modules/optipng-bin/pre-build.js:4:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
npm ERR! [email protected] postinstall: node pre-build.js
npm ERR! sh "-c" "node pre-build.js" failed with 8
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the optipng-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node pre-build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls optipng-bin
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 11.4.2
npm ERR! command "/usr/local/Cellar/node/0.10.1/bin/node" "/usr/local/bin/npm" "install" "optipng-bin"
npm ERR! cwd /Users/XXXXX/cliproto
npm ERR! node -v v0.10.1
npm ERR! npm -v 1.2.15
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/XXXXXX/cliproto/npm-debug.log
npm ERR! not ok code 0

npm install grunt-contrib-imagemin on Windows results in Optipng error

simply put, installig goptipng via [email protected] results in an error with optipng.

npm ERR! [email protected] postinstall: node pre-build.js
npm ERR! cmd "/c" "node pre-build.js" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the optipng-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node pre-build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls optipng-bin
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\Program Files (x86)\nodejs\node.exe" "c:\Program Files
(x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "grunt-contrib-imag
emin"
npm ERR! not ok code 0

optipng-bin failed to install

Getting this error all of a sudden

/Users/farski/Desktop/prx4-fe/node_modules/gulp-imagemin/index.js:50
.use(Imagemin.optipng({optimizationLevel: options.optimizationLevel}))
              ^
TypeError: Property 'optipng' of object function Imagemin() {
if (!(this instanceof Imagemin)) {
return new Imagemin();
}

this.streams = [];
} is not a function
    at DestroyableTransform.percent (/Users/farski/Desktop/prx4-fe/node_modules/gulp-imagemin/index.js:50:19)
    at Object.immediate._onImmediate (timers.js:363:16)
    at processImmediate [as _immediateCallback] (timers.js:345:15)

Minimize size

Currently this module takes 9.3MB.

We could reduce that by removing the source and unneeded binaries in the install script at the end.

What do you think?

also applies to jpegtran

@passy @kevva

Compile error on centos 5

[email protected] postinstall /usr/local/lib/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin
node lib/install.js

 warn : optipng pre-build test failed
 info : compiling from source
error : Error: Command failed: pngrtran.c:98: warning: ‘png_rtran_ok’ defined but not used

pngxmem.c: In function ‘pngx_malloc_rows_extended’:
pngxmem.c:37: warning: comparison is always false due to limited range of data type
ratio.c:25: error: conflicting types for ‘opng_longest_impl_t’
ratio.c:24: error: previous declaration of ‘opng_longest_impl_t’ was here
ratio.c:76: error: expected declaration specifiers or ‘...’ before ‘opng_ulongest_impl_t’
ratio.c:76: error: expected declaration specifiers or ‘...’ before ‘opng_ulongest_impl_t’
ratio.c: In function ‘opng_sprint_uratio_impl’:
ratio.c:90: error: ‘opng_ulongest_impl_t’ undeclared (first use in this function)
ratio.c:90: error: (Each undeclared identifier is reported only once
ratio.c:90: error: for each function it appears in.)
ratio.c:90: error: expected ‘;’ before ‘integer_part’
ratio.c:95: error: ‘denom’ undeclared (first use in this function)
ratio.c:97: error: ‘num’ undeclared (first use in this function)
ratio.c:117: error: ‘integer_part’ undeclared (first use in this function)
ratio.c:118: error: ‘remainder’ undeclared (first use in this function)
ratio.c: In function ‘opng_ulratio_to_factor_string’:
ratio.c:158: error: ‘opng_ulongest_impl_t’ undeclared (first use in this function)
ratio.c:158: error: expected ‘;’ before ‘num’
ratio.c:159: error: expected ‘;’ before ‘denom’
ratio.c:160: error: ‘num’ undeclared (first use in this function)
ratio.c:160: error: ‘denom’ undeclared (first use in this function)
ratio.c:160: error: too many arguments to function ‘opng_sprint_uratio_impl’
ratio.c:156: warning: unused parameter ‘ratio’
ratio.c: In function ‘opng_ulratio_to_percent_string’:
ratio.c:170: error: ‘opng_ulongest_impl_t’ undeclared (first use in this function)
ratio.c:170: error: expected ‘;’ before ‘num’
ratio.c:171: error: expected ‘;’ before ‘denom’
ratio.c:172: error: ‘num’ undeclared (first use in this function)
ratio.c:172: error: ‘denom’ undeclared (first use in this function)
ratio.c:172: error: too many arguments to function ‘opng_sprint_uratio_impl’
ratio.c:168: warning: unused parameter ‘ratio’
make[1]: *** [ratio.o] Error 1
make: *** [install] Error 2

at ChildProcess.exithandler (child_process.js:648:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Socket.<anonymous> (child_process.js:969:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)

Hanging when node_modules is a symlink (since version 2.0.1)

I'm a Snap CI developer and there's a customer of us who is facing a problem that seems to be a bug when the node_module is a symlink.

I've created a project on Snap CI in order to illustrate the problem. @kevva, I've added you as a collaborator, so you can see the pipeline configuration here. Feel free to change it if you need.

Thank you.

-- Andrei Tognolo

optping-bin does not compile

Hi all,

optipng-bin failed to compiled under centos 7.2

> [email protected] postinstall /var/lib/jenkins/workspace/checkout/node_modules/optipng-bin
> node lib/install.js

  ⚠ unable to get local issuer certificate
  ⚠ optipng pre-build test failed
  ℹ compiling from source
  ✖ Error: ./configure --with-system-zlib --prefix="/var/lib/jenkins/workspace/checkout/node_modules/optipng-bin/vendor" --bindir="/var/lib/jenkins/workspace/checkout/node_modules/optipng-bin/vendor" && make install
Command failed: /bin/sh -c ./configure --with-system-zlib --prefix="/var/lib/jenkins/workspace/checkout/node_modules/optipng-bin/vendor" --bindir="/var/lib/jenkins/workspace/checkout/node_modules/optipng-bin/vendor"
/bin/sh: ./configure: No such file or directory

What could have been done to find out why?

Streaming interface does not validate success

When issue #29 occurs, optipng fails silently. In this case, the streaming interface does not check that the destination file was correctly created, which causes the output stream to have zero bytes.

If possible, the streaming interface should check for successful creation of the output file, and if it doesn't exist, emit 'error' on the stream.

optipng-bin failed to install on windows 7

I'm attempting to install grunt-contrib-imagemin. I'm running all the commands from the command line tool running as Administrator. When installing, I get the following output:

$ npm install grunt-contrib-imagemin --save-dev
npm WARN package.json sample-test@1.0.0 No description
npm WARN package.json sample-test@1.0.0 No repository field.
npm WARN package.json sample-test@1.0.0 No README data
|


> optipng-bin@3.0.2 postinstall C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_module
s\imagemin-optipng\node_modules\optipng-bin
> node lib/install.js

   Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\grunt-contrib-imagemin\node_modul
es\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\vendor\optipng.exe --version"
'C:\Users\aaron.ward\Downloads\VZCON-2806' is not recognized as an internal or external command,
operable program or batch file.

   optipng pre-build test failed
  i compiling from source
  × Error: ./configure --with-system-zlib --prefix="C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\grunt-contrib-imagemin\node_modules\
imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\vendor" --bindir="C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\grunt-
contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\vendor" && make install
Command failed: C:\Windows\system32\cmd.exe /s /c "./configure --with-system-zlib --prefix="C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modu
les\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\vendor" --bindir="C:\Users\aaron.ward\Downloads\VZCON-2806
HTML\VZCON-2806 HTML\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\vendor""
'.' is not recognized as an internal or external command,
operable program or batch file.

    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)

> [email protected] postinstall C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modul
es\imagemin-jpegtran\node_modules\jpegtran-bin
> node lib/install.js

  √ jpegtran pre-build test passed successfully

> [email protected] postinstall C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\i
magemin-gifsicle\node_modules\gifsicle
> node lib/install.js

  √ gifsicle pre-build test passed successfully
[email protected] node_modules\grunt-contrib-imagemin
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], stream-combiner2@1.
0.2, [email protected], [email protected], [email protected], [email protected], [email protected])

Thinking it might have been the package itself, I uninstalled grunt-contrib-imagemin and installed the optipng-bin package directly. Those errors are here:

$ npm install --save optipng-bin
npm WARN package.json sample-test@1.0.0 No description
npm WARN package.json sample-test@1.0.0 No repository field.
npm WARN package.json sample-test@1.0.0 No README data
-
> optipng-bin@3.0.2 postinstall C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\optipng-bin
> node lib/install.js

   Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\optipng-bin\vendor\optipng.exe --version"
'C:\Users\aaron.ward\Downloads\VZCON-2806' is not recognized as an internal or external command,
operable program or batch file.

   optipng pre-build test failed
  i compiling from source
  × Error: ./configure --with-system-zlib --prefix="C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\optipng-bin\vendor" --bindir="C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\optipng-bin\vendor" && make install
Command failed: C:\Windows\system32\cmd.exe /s /c "./configure --with-system-zlib --prefix="C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\optipng-bin\vendor" --bindir="C:\Users\aaron.ward\Downloads\VZCON-2806 HTML\VZCON-2806 HTML\node_modules\optipng-bin\vendor""
'.' is not recognized as an internal or external command,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:744:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1008:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
[email protected] node_modules\optipng-bin
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

I'm trying to set this up while doing a few tutorials on image compression. What might I be missing on installing this package? All other packages I have installed have been very straight-forward. While I have noticed some other having similar issues, I'm not behind any type of firewall or proxy...

cannot find module 'win-spawn'

file vendor/optipng contains the require. I don't have this installed globally

#!/usr/bin/env node
'use strict';

var binPath = require('./').path;
var spawn = require('win-spawn');

spawn(binPath, process.argv.slice(2), { stdio: 'inherit' })
    .on('exit', process.exit);

Not compiling on Windows

Happy to help debug if you need more info. Here's what I see:

$ npm install optipng-bin
|
> [email protected] postinstall c:\Users\bprofitt\Documents\NetBeansProjects\header\node_modules\optipng-bin
> node lib/install.js

‼ pre-build test failed, compiling from source...
x { [Error: Command failed: '.' is not recognized as an internal or external command,
operable program or batch file.
] killed: false, code: 1, signal: null }

unable to verify the first certificate

Hello,

I support users behind a corporate firewall with SSL inspection. Nothing gets declared on the clients in terms of the proxy except that they need a copy of some certificates for any SSL connections to be recognized as valid.

I have set these certificates in the cafile variable in npm config. I still get this error when a user tries to install your package (as a dependency from imagemin).

[email protected] postinstall /Users/lrivera/testnpm/node_modules/optipng-bin
node lib/install.js

⚠ unable to verify the first certificate
⚠ optipng pre-build test failed
ℹ compiling from source

I can get past it by turning off strict ssl or setting node to not fail on TLS failure, but that's not a great option.

I did read something in all my searching saying that maybe individual packages weren't reading from the cafile config variable. They specifically called out another package that set up a download (similar to what the install.js here does for what I can tell).

I'm not sure where I would see for sure that this package was checking for a cafile, but maybe you can help with this issue in general?

edit: I edited everything to try and make my request clearer.

Cannot execute optipng binary file after updating Node.js to 5.9.1

Worked fine on 5.9.0. I'm on OS X El Capitan 10.11.3.

Now I get this error:

ERROR in ./src/core/components/Navbar/UserControls/assets/profile.png
Module build failed: Error: Command failed: /project/node_modules/optipng-bin/vendor/optipng -strip all -clobber -force -fix -out /var/folders/3x/8912scxx07xdrrvpyljfcl140000gt/T/401ff2af-988e-49eb-9423-c89a2ba6f46d /var/folders/3x/8912scxx07xdrrvpyljfcl140000gt/T/4cabb390-60ff-4501-8078-fe3a39d3dad3
/project/node_modules/optipng-bin/vendor/optipng: /project/node_modules/optipng-bin/vendor/optipng: cannot execute binary file

    at ChildProcess.exithandler (child_process.js:202:12)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at Pipe._onclose (net.js:477:12)
 @ ./src/core/components/Navbar/UserControls/UserControls.js 71:68-99

It is ran through webpack with image-webpack-loader, but the same error occurs when executing file without any args.

Issue with grunt-contrib-imagemin pointing at optipng-bin

the last few set of changes to optipng-bin break clean installs of both [email protected] and 0.7.0

I've tried clean installs, after a cache clean.

[email protected] postinstall /home/dev/web/instance/node_modules/imagemin-optipng/node_modules/optipng-bin
node index.js

/home/dev/web/instance/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/index.js:145
if (msg.indexOf(self.opts.version) !== -1) {
^
TypeError: Cannot call method 'indexOf' of undefined
at /home/dev/web/instance/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/index.js:145:29
at ChildProcess. (/home/dev/web/instance/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/bin-check/index.js:46:24)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:797:12)
npm ERR! [email protected] postinstall: node index.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.

Windows 7 install fails

Window 7 64 bit

As part of "grunt-contrib-imagemin": "^0.9.2", Everything installs OK except
I get the following error on optipng-bin:

> [email protected] postinstall J:\integra\html\node_modules\grunt-contrib-image
min\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin

> node lib/install.js

  ‼ EPERM, symlink 'c:\ProgramData\chocolatey\bin\optipng.exe'
  ‼ optipng pre-build test failed
  i compiling from source
  × Error: ./configure --with-system-zlib --prefix="J:\integra\html\node_modules
\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node
_modules\optipng-bin\vendor" --bindir="J:\integra\html\node_modules\grunt-contri
b-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\opti
png-bin\vendor" && make install
Command failed: '.' is not recognized as an internal or external command,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:658:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:766:16)
    at Process.ChildProcess._handle.onexit (child_process.js:833:5)

Malware?

Hello,

I installed this on Windows and Microsoft Security Essentials (anti-virus app) is complaining that the following file has Malware:

...\optipng-bin\vendor\win32\optipng.exe

The exact error from Security Essentials:

Security Essentials encountered the following error: Error code 0x80508023. The program could not find the malware and other potentially unwanted software on this computer. 

Category: Password Stealer

Description: This program is dangerous and captures user passwords.

Recommended action: Remove this software immediately.

Items: 
file:...\optipng-bin\vendor\win32\optipng.exe

Get more information about this item online.

The detected malware is PWS:Win32/Lineage.gen!C.dam.

I have absolutely NEVER seen Security Essentials finding malware before, after many years of use, so it's not like it is prone to false positives. It would be wise to get to the bottom of this issue.

NPM install failing

I'm not sure if this is due to the 0.2.0 release that just happened (and I'm new to using NPM to handle package management), but I'm now getting the following error that I wasn't getting previously when installing optipng-bin:

npm ERR! [email protected] postinstall: `node rebuild-optipng.js`
npm ERR! `sh "-c" "node rebuild-optipng.js"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the optipng-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node rebuild-optipng.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls optipng-bin
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.2.0
npm ERR! command "/opt/local/bin/node" "/opt/local/bin/npm" "install"
npm ERR! cwd /path/removed
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /path/removed/npm-debug.log
npm ERR! not ok code 0

I'm on OSX 10.8, grunt-cli v0.1.6, grunt v0.4.0a. Optipng-bin is being installed as a dependency for grunt-contrib-imagemin.

Error: Cannot find module 'chalk'

> [email protected] postinstall /var/sites/vifeed.dev/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/optipng-bin
> node index.js


module.js:340
    throw err;
          ^
Error: Cannot find module 'chalk'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/sites/vifeed.dev/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/optipng-bin/index.js:4:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

optipng portability

Is this package portable between OS?

I have a grunt.js based build for a web app that uses grunt-contrib-imagemin which has a dependency on optipng-bin. I have my node_modules folder checked in as I've had issues with dependencies changing between builds (other projects) but now I'm seeing an issue setting this up to build under Jenkins CI on Ubuntu 12.04:

    Warning: Running "imagemin:dist" (imagemin) task
Warning: Command failed: /mnt/sf/jenkins/workspace/camaro-admin/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng: 6: /mnt/sf/jenkins/workspace/camaro-admin/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng: Syntax error: newline unexpected 

For our development boxes we are all running OS X. Is this an issue of platform specific binaries in optipng?

on both systems:

$ npm list optipng-bin
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected]  

Latest version failing to compile

Hi,

I'm having problems while compiling the latest version (0.3.9):

✗ pre-build test failed, compiling from source...
✗ Error: Command failed: pngrtran.c:98: warning: 'png_rtran_ok' defined but not used
pngxmem.c: In function 'pngx_malloc_rows_extended':
pngxmem.c:37: warning: comparison is always false due to limited range of data type
ratio.c:25: error: conflicting types for 'opng_longest_impl_t'
ratio.c:24: error: previous declaration of 'opng_longest_impl_t' was here
ratio.c:76: error: expected declaration specifiers or '...' before 'opng_ulongest_impl_t'
ratio.c:76: error: expected declaration specifiers or '...' before 'opng_ulongest_impl_t'
ratio.c: In function 'opng_sprint_uratio_impl':
ratio.c:90: error: 'opng_ulongest_impl_t' undeclared (first use in this function)
ratio.c:90: error: (Each undeclared identifier is reported only once
ratio.c:90: error: for each function it appears in.)
ratio.c:90: error: expected ';' before 'integer_part'
ratio.c:95: error: 'denom' undeclared (first use in this function)
ratio.c:97: error: 'num' undeclared (first use in this function)
ratio.c:117: error: 'integer_part' undeclared (first use in this function)
ratio.c:118: error: 'remainder' undeclared (first use in this function)
ratio.c: In function 'opng_ulratio_to_factor_string':
ratio.c:158: error: 'opng_ulongest_impl_t' undeclared (first use in this function)
ratio.c:158: error: expected ';' before 'num'
ratio.c:159: error: expected ';' before 'denom'
ratio.c:160: error: 'num' undeclared (first use in this function)
ratio.c:160: error: 'denom' undeclared (first use in this function)
ratio.c:160: error: too many arguments to function 'opng_sprint_uratio_impl'
ratio.c:156: warning: unused parameter 'ratio'
ratio.c: In function 'opng_ulratio_to_percent_string':
ratio.c:170: error: 'opng_ulongest_impl_t' undeclared (first use in this function)
ratio.c:170: error: expected ';' before 'num'
ratio.c:171: error: expected ';' before 'denom'
ratio.c:172: error: 'num' undeclared (first use in this function)
ratio.c:172: error: 'denom' undeclared (first use in this function)
ratio.c:172: error: too many arguments to function 'opng_sprint_uratio_impl'
ratio.c:168: warning: unused parameter 'ratio'
make[2]: *** [ratio.o] Error 1
make[1]: *** [install] Error 2

postinstall is failing with [email protected]

...
npm verb about to build /Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/optipng-bin
npm info build /Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/optipng-bin
npm verb linkStuff [ false,
npm verb linkStuff   false,
npm verb linkStuff   false,
npm verb linkStuff   '/Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules' ]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb link bins [ { optipng: 'cli.js' },
npm verb link bins   '/Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/.bin',
npm verb link bins   false ]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm verb gentlyRm vacuuming /Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/.bin/optipng
npm verb rebuildBundles [ 'bin-build', 'bin-wrapper', 'imagemin-log' ]
npm info install [email protected]
npm info postinstall [email protected]

> [email protected] postinstall /Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/optipng-bin
> node lib/install.js


path.js:360
        throw new TypeError('Arguments to path.join must be strings');
              ^
TypeError: Arguments to path.join must be strings
    at path.js:360:15
    at Array.filter (native)
    at exports.join (path.js:358:36)
    at Object.exports.json (/Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/rc/lib/utils.js:21:24)
    at module.exports (/Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/rc/index.js:35:21)
    at Object.<anonymous> (/Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/index.js:5:25)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
npm verb unsafe-perm in lifecycle true
npm info [email protected] Failed to exec postinstall script
npm verb unlock done using /Users/sean/.npm/_locks/optipng-bin-aadef6d391e64368.lock for /Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng/node_modules/optipng-bin
npm verb about to build /Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng
npm verb unlock done using /Users/sean/.npm/_locks/imagemin-optipng-893e6bbcd05a2d5f.lock for /Users/sean/Development/workspaces/tmpl-test2/node_modules/imagemin-optipng
npm verb stack Error: [email protected] postinstall: `node lib/install.js`
npm verb stack Exit status 8
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:212:16)
npm verb stack     at ChildProcess.emit (events.js:98:17)
npm verb stack     at maybeClose (child_process.js:756:16)
npm verb stack     at Process.ChildProcess._handle.onexit (child_process.js:823:5)
npm verb pkgid [email protected]
npm verb cwd /Users/sean/Development/workspaces/tmpl-test2
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "[email protected]"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node lib/install.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the optipng-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node lib/install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls optipng-bin
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]
npm verb unbuild node_modules/imagemin-optipng/node_modules/optipng-bin
npm info preuninstall [email protected]
npm info uninstall [email protected]
...

npm install error

Hi there,

The latest version 0.3.0 fails to install for me via npm, 0.2.6 is fine

> [email protected] postinstall path/node_modules/optipng-bin
> node pre-build.js


module.js:340
    throw err;
          ^
Error: Cannot find module '/path/node_modules/optipng-bin/pre-build.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:245:9)

Build failing on Windows

Might be related to #3. I'm getting the following on Windows:


C:\Test>npm install optipng-bin
npm http GET https://registry.npmjs.org/optipng-bin
npm http 304 https://registry.npmjs.org/optipng-bin
npm http GET https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/exec-sync
npm http 304 https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/exec-sync
npm http GET https://registry.npmjs.org/ffi/1.1.2
npm http 304 https://registry.npmjs.org/ffi/1.1.2
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/ref-struct
npm http GET https://registry.npmjs.org/ref
npm http 304 https://registry.npmjs.org/ref
npm http 304 https://registry.npmjs.org/ref-struct
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/bindings

> [email protected] install C:\Test\node_modules\optipng-bin\node_modules\exec-sync\node_modules\ffi\node_modules\ref
> node-gyp rebuild


C:\Test\node_modules\optipng-bin\node_modules\exec-sync\node_modules\ffi\node_modules\ref>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-
bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
C:\Test\node_modules\optipng-bin\node_modules\exec-sync\node_modules\ffi\node_modules\ref\build\binding.vcxproj(18,3): error MSB4019: The imported pr
oject "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `c:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:255:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Test\node_modules\optipng-bin\node_modules\exec-sync\node_modules\ffi\node_modules\ref
gyp ERR! node -v v0.8.20
gyp ERR! node-gyp -v v0.8.4
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the ref package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls ref
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "optipng-bin"
npm ERR! cwd C:\Test
npm ERR! node -v v0.8.20
npm ERR! npm -v 1.2.11
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Test\npm-debug.log
npm ERR! not ok code 0

FreeBSD x64 support

$ npm i optipng-bin
-
> [email protected] postinstall /usr/local/myproject/node_modules/optipng-bin
> node lib/install.js

ELF interpreter /libexec/ld-elf.so.1 not found
  ⚠ The `/usr/local/myproject/node_modules/optipng-bin/vendor/optipng` binary doesn't seem to work correctly
  ⚠ optipng pre-build test failed
  ℹ compiling from source
  ✖ Error: ./configure --with-system-zlib --prefix="/usr/local/myproject/node_modules/optipng-bin/vendor" --bindir="/usr/local/myproject/node_modules/optipng-bin/vendor" && make install
Command failed: /bin/sh -c make install
usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file target_file
       cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file ... target_directory

    at ChildProcess.exithandler (child_process.js:203:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:817:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)
[email protected] node_modules/optipng-bin
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

I'm guessing this guy is 32-bit?

I'll try to build you a 64-bit one if you're willing to accept a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.