Giter VIP home page Giter VIP logo

jpegtran-bin's Introduction

imagemin

Minify images seamlessly





Install

npm install imagemin

Usage

import imagemin from 'imagemin';
import imageminJpegtran from 'imagemin-jpegtran';
import imageminPngquant from 'imagemin-pngquant';

const files = await imagemin(['images/*.{jpg,png}'], {
	destination: 'build/images',
	plugins: [
		imageminJpegtran(),
		imageminPngquant({
			quality: [0.6, 0.8]
		})
	]
});

console.log(files);
//=> [{data: <Uint8Array 89 50 4e …>, destinationPath: 'build/images/foo.jpg'}, …]

API

imagemin(input, options?)

Returns Promise<object[]> in the format {data: Uint8Array, sourcePath: string, destinationPath: string}.

input

Type: string[]

File paths or glob patterns.

options

Type: object

destination

Type: string

Set the destination folder to where your files will be written. If no destination is specified, no files will be written.

plugins

Type: Array

The plugins to use.

glob

Type: boolean
Default: true

Enable globbing when matching file paths.

imagemin.buffer(data, options?)

Returns Promise<Uint8Array>.

data

Type: Uint8Array

The image data to optimize.

options

Type: object

plugins

Type: Array

Plugins to use.

Related

jpegtran-bin's People

Contributors

1000ch avatar bigmichi1 avatar gcallaghan avatar hnakamur avatar jonathonwalz avatar jorrit avatar kevcenteno avatar kevva avatar nervo avatar passy avatar radum avatar sboudrias avatar sebdeckers avatar sergeylukin avatar shinnn avatar sindresorhus avatar socketwiz avatar youcandanch 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jpegtran-bin's Issues

Download binaries behind a proxy

pre-build.js is using request module to download the binaries, it will not work if you are behind a proxy. Simple solution could be, put this before return statement:

if(process.env.HTTPS_PROXY) 
      request = request.defaults({'proxy':process.env.HTTPS_PROXY});

Failed at the [email protected] postinstall script 'node pre-build.js'.

Failure to install on Windows 7 running under Command Prompt as Administrator.

Disclaimer: I'm new to npm, grunt etc. and have been having problems with npm on Windows for a week now, my understanding is that this stuff is meant to just work, though I have a suspicion that Windows is less used and more likely where the bugs are. I'm not really sure how to troubleshoot, sorry.

The end of the more -in-depth npm log is at the bottom.

npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v5.1.1
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node pre-build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node pre-build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the jpegtran-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 information on how to open an issue for this project with:
npm ERR! npm bugs jpegtran-bin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls jpegtran-bin
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\DATA\Git\The Censored Product\Web.UI\npm-debug.log

-- npm-debug.log follows --

...
90431 info lifecycle [email protected]postinstall: [email protected]
90432 verbose lifecycle [email protected]
postinstall: unsafe-perm in lifecycle true
90433 verbose lifecycle [email protected]postinstall: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\DATA\Git\The Censored Product\Web.UI\node_modules\jpegtran-bin\node_modules.bin;C:\DATA\Git\The Censored Product\Web.UI\node_modules.bin;[Censored Values];C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Users\user.name\AppData\Roaming\npm
90434 verbose lifecycle [email protected]
postinstall: CWD: C:\DATA\Git\The Censored Product\Web.UI\node_modules\jpegtran-bin
90435 silly lifecycle [email protected]postinstall: Args: [ '/d /s /c', 'node pre-build.js' ]
90436 silly lifecycle [email protected]
postinstall: Returned: code: 1 signal: null
90437 info lifecycle [email protected]~postinstall: Failed to exec postinstall script
90438 verbose unlock done using C:\Users\user.name\AppData\Roaming\npm-cache_locks\staging-686cce0fed838b08.lock for C:\DATA\Git\The Censored Product\Web.UI\node_modules.staging
90439 silly rollbackFailedOptional Starting
90440 silly rollbackFailedOptional Finishing
90441 silly runTopLevelLifecycles Starting
90442 silly runTopLevelLifecycles Finishing
90443 silly install printInstalled
90444 warn [email protected] No repository field.
90445 warn [email protected] No license field.
90446 verbose stack Error: [email protected] postinstall: node pre-build.js
90446 verbose stack Exit status 1
90446 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:232:16)
90446 verbose stack at emitTwo (events.js:87:13)
90446 verbose stack at EventEmitter.emit (events.js:172:7)
90446 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
90446 verbose stack at emitTwo (events.js:87:13)
90446 verbose stack at ChildProcess.emit (events.js:172:7)
90446 verbose stack at maybeClose (internal/child_process.js:818:16)
90446 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
90447 verbose pkgid [email protected]
90448 verbose cwd C:\DATA\Git\The Censored Product\Web.UI
90449 error Windows_NT 6.1.7601
90450 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
90451 error node v5.1.1
90452 error npm v3.5.2
90453 error code ELIFECYCLE
90454 error [email protected] postinstall: node pre-build.js
90454 error Exit status 1
90455 error Failed at the [email protected] postinstall script 'node pre-build.js'.
90455 error Make sure you have the latest version of node.js and npm installed.
90455 error If you do, this is most likely a problem with the jpegtran-bin package,
90455 error not with npm itself.
90455 error Tell the author that this fails on your system:
90455 error node pre-build.js
90455 error You can get information on how to open an issue for this project with:
90455 error npm bugs jpegtran-bin
90455 error Or if that isn't available, you can get their info via:
90455 error npm owner ls jpegtran-bin
90455 error There is likely additional logging output above.
90456 verbose exit [ 1, true ]

jpegtran Build Fails ...

When I try to install gulp-imagemin (OS X 10.7.5), I get the following jpegtran-bin build error. Any ideas? Thanks, Chris

[email protected] postinstall /Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin
node lib/install.js
⚠ The /Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor/jpegtran binary doesn't seem to work correctly
⚠ jpegtran pre-build test failed
ℹ compiling from source
✖ Error: touch configure.ac aclocal.m4 configure Makefile.am Makefile.in && ./configure --disable-shared --prefix="/Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor" --bindir="/Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor" && make install
Command failed: /bin/sh -c ./configure --disable-shared --prefix="/Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor" --bindir="/Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor"
configure: error: installation or configuration problem: assembler cannot create object files.

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Socket. (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)

Cannot work with system jpegtrans binary.

OS: Solaris 11
node: 0.10.0

libjpeg-turbo:

libjpeg-turbo version 1.3.0 (build 20130823)
Copyright (C) 1991-2012 Thomas G. Lane, Guido Vollbeding

Looking into the sources I see that jpegtran-bin expects the binary in its lib directory, right ? When a symlink is placed there, I got error on test:

# node jpegtran-test.js

/usr/local/libjpeg-turbo/bin/jpegtran:1
(function (exports, require, module, __filename, __dirname) {ELF
                                                              ^
SyntaxError: Unexpected token ILLEGAL
    at Module._compile (module.js:439:25)
    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)
    at require (module.js:380:17)
    at Object.<anonymous> (/root/jpegtran-test.js:2:20)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

When no symlink exists, it just says 'Image minified' but nothing happens.

Join forces?

It looks like I snatched the jpegtran name in npm without being aware that this module was underway.

My module exposes an already installed jpegtran as a readable/writable stream: https://github.com/papandreou/node-jpegtran -- but it would be pretty cool to have the pre-built binaries bundled with the package.

Exactly the same thing happened with https://github.com/papandreou/node-optipng vs. https://github.com/yeoman/node-optipng ... I also did wrappers for pngcrush and pngquant. Were you also planning on doing pre-built binaries for those, by any chance?

postinstall error on 64 bit Windows 7

> [email protected] postinstall C:\projects\generator-zf5\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin
> node lib/install.js

  ‼ ENOENT, stat 'C:\projects\generator-zf5\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\vendor\jpegtran.exe'
  ‼ jpegtran pre-build test failed
  i compiling from source
  × Error: Command failed: Der Befehl "." ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

    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)

Translation of the German "Der Befehl "." ist entweder falsch geschrieben oder
konnte nicht gefunden werden.":

"The command '.' is either badly spelled or could not be found."

Fix build

Works locally but fails on Travis CI.

jpegtran suddenly doesn't build on heroku

which is weird, because there were no version bumps or anything since the last time it worked.

       > [email protected] postinstall /tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin
       > node pre-build.js



         ✖ 4 of 3 tests failed:

         1) jpegtran should return path to jpegtran binary:
            AssertionError: false == true
             at /tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin/test/test-jpegtran-path.js:18:4
             at ChildProcess.exithandler (child_process.js:641:7)
             at ChildProcess.EventEmitter.emit (events.js:98:17)
             at maybeClose (child_process.js:735:16)
             at Socket.<anonymous> (child_process.js:948:11)
             at Socket.EventEmitter.emit (events.js:95:17)
             at Pipe.close (net.js:466:12)

         2) jpegtran should successfully proxy jpegtran:
            AssertionError: false == true
             at /tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin/test/test-jpegtran-path.js:27:4
             at ChildProcess.exithandler (child_process.js:641:7)
             at ChildProcess.EventEmitter.emit (events.js:98:17)
             at maybeClose (child_process.js:735:16)
             at Process.ChildProcess._handle.onexit (child_process.js:802:5)

         3) jpegtran should minify a .jpg:
            Error: ENOENT, no such file or directory 'test/minified.jpg'
             at Object.fs.statSync (fs.js:684:18)
             at /tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin/test/test-jpegtran-path.js:42:20
             at ChildProcess.exithandler (child_process.js:641:7)
             at ChildProcess.EventEmitter.emit (events.js:98:17)
             at maybeClose (child_process.js:735:16)
             at Process.ChildProcess._handle.onexit (child_process.js:802:5)

         4) jpegtran "after all" hook:
            Error: ENOENT, no such file or directory 'test/minified.jpg'
             at Object.fs.unlinkSync (fs.js:760:18)
             at Context.<anonymous> (/tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin/test/test-jpegtran-path.js:11:6)
             at Hook.Runnable.run (/tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin/node_modules/mocha/lib/runnable.js:213:32)
             at next (/tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin/node_modules/mocha/lib/runner.js:243:10)
             at Object._onImmediate (/tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin/node_modules/mocha/lib/runner.js:254:5)
             at processImmediate [as _immediateCallback] (timers.js:330:15)


       pre-build test failed, compiling from source...
       Fetching http://downloads.sourceforge.net/project/libjpeg-turbo/1.2.90%20%281.3beta1%29/libjpeg-turbo-1.2.90.tar.gz...
       Done in /tmp/libjpeg-turbo-1.2.90

       Building libjpeg-turbo...
       Built from source.

       /tmp/build_ubysxi5sclbb/node_modules/jpegtran-bin/build.js:78
                                throw err;
                                      ^
       Error: Command failed: configure: error: no nasm (Netwide Assembler) found

           at ChildProcess.exithandler (child_process.js:637:15)
           at ChildProcess.EventEmitter.emit (events.js:98:17)
           at maybeClose (child_process.js:735:16)
           at Process.ChildProcess._handle.onexit (child_process.js:802:5)
       npm WARN optional dep failed, continuing [email protected]

it does seem to work when i test just node-jpegtran-bin, but not when i use it as a dependency

Can't build on Windows 7 64bits

> [email protected] postinstall C:\Users\Webdev\Inetpub\gym\node_modules\grunt-contrib\node_modules\grunt-contrib-imagemin\node_modules\jpegtran-bin
> node build.js

C:\Users\Webdev\.node-gyp\0.8.22\deps\uv\include\uv.h(55): fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
C:\Users\Webdev\.node-gyp\0.8.22\deps\uv\include\uv.h(55): fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
Project : warning PRJ0018: The following environment variables were not found:
Project : warning PRJ0018: The following environment variables were not found:
C:\Users\Webdev\.node-gyp\0.8.22\deps\uv\include\uv.h(55): fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
Project : warning PRJ0018: The following environment variables were not found:

node 0.8.22, npm 1.2.14

C:\Users\Webdev\Inetpub\gym>which VCBuild.exe
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\VCBuild.exe

Not work in heroku

Error: /app/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/vendor/jpegtran: 1: Syntax error: "(" unexpected
✔ app/images/warranty.jpg (already optimized)

Error: Cannot find module './build.js'

I can't install jpegtran-bin on my system:

[email protected] postinstall /home/bluefox/Projects/dev-biz/gustaff-sandbox/webclient/gweb-yeoman/node_modules/jpegtran-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.<anonymous> (/home/bluefox/Projects/dev-biz/gustaff-sandbox/webclient/gweb-yeoman/node_modules/jpegtran-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 jpegtran-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 jpegtran-bin
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.7.10-gentoo
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "jpegtran-bin"
npm ERR! cwd /home/bluefox/Projects/dev-biz/gustaff-sandbox/webclient/gweb-yeoman
npm ERR! node -v v0.10.3
npm ERR! npm -v 1.2.17
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/bluefox/Projects/dev-biz/gustaff-sandbox/webclient/gweb-yeoman/npm-debug.log
npm ERR! not ok code 0

npm install is failing

npm install is failing because decompress lib depends on map-key project that is removed from npm

No read permission on jpegtran binary

The jpegtran binary created on postinstall has no user read permission. This causes a problem when trying to do something like tar the node_modules directory because it throws a permission denied error. This happens both on Linux and Mac OS. I tried to find where the permission is getting set but was unable to locate the source of the issue. For now in my CI plans I'm just chown-ing the files, but that's not ideal. Happy to contribute if you can point me towards a method for resolution.

Steps to reproduce:

  • npm install jpegtran-bin
  • ls -al node_modules/jpegtran-bin/vendor

You'll see the following output:

--wxrw--wt 1 rleland staff 135K Sep 26 09:58 jpegtran

Don't compile & install jpegtran if already installed on the system

I've seen this (maybe) related issue... but I wonder why this package can't try to use the already installed system binary if present.

For example, I'm running a project on ARM architecture. The binary is not present (BTW I could make a PR to provide a linux/armv7/jpegtran binary).

postinstall error : Cannot find module '/usr/local/lib/node_modules/jpegtran-bin/pre-build.js'

Running install with npm 1.2.18 and node 0.10.4, I get the following post install error :

$ sudo npm install jpegtran-bin -g

npm http GET https://registry.npmjs.org/jpegtran-bin
npm http 200 https://registry.npmjs.org/jpegtran-bin
npm http GET https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-0.2.0.tgz
npm http 200 https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-0.2.0.tgz
npm http GET https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/mocha
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/mkdirp
npm http 200 https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/which/-/which-1.0.5.tgz
npm http 200 https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/chalk/-/chalk-0.2.0.tgz
npm http 200 https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/tar/-/tar-0.1.18.tgz
npm http 200 https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 https://registry.npmjs.org/mocha
npm http GET https://registry.npmjs.org/mocha/-/mocha-1.12.0.tgz
npm http 200 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/request/-/request-2.26.0.tgz
npm http 200 https://registry.npmjs.org/chalk/-/chalk-0.2.0.tgz
npm http 200 https://registry.npmjs.org/which/-/which-1.0.5.tgz
npm http 200 https://registry.npmjs.org/tar/-/tar-0.1.18.tgz
npm http 200 https://registry.npmjs.org/request/-/request-2.26.0.tgz
npm http 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 https://registry.npmjs.org/mocha/-/mocha-1.12.0.tgz
npm http GET https://registry.npmjs.org/has-color
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/block-stream
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/http-signature
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/commander/0.6.1
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/diff/1.0.2
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/ms/0.3.0
npm http GET https://registry.npmjs.org/glob/3.2.1
npm http 200 https://registry.npmjs.org/has-color
npm http GET https://registry.npmjs.org/has-color/-/has-color-0.1.1.tgz
npm http 200 https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/ansi-styles/-/ansi-styles-0.2.0.tgz
npm http 200 https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.0.tgz
npm http 200 https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz
npm http 200 https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz
npm http 200 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/inherits/-/inherits-2.0.0.tgz
npm http 200 https://registry.npmjs.org/block-stream
npm http 200 https://registry.npmjs.org/fstream
npm http 200 https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz
npm http GET https://registry.npmjs.org/fstream/-/fstream-0.1.24.tgz
npm http GET https://registry.npmjs.org/aws-sign/-/aws-sign-0.3.0.tgz
npm http 200 https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz
npm http 200 https://registry.npmjs.org/node-uuid
npm http 200 https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz
npm http 200 https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz
npm http GET https://registry.npmjs.org/mime/-/mime-1.2.11.tgz
npm http 200 https://registry.npmjs.org/form-data
npm http 200 https://registry.npmjs.org/commander/0.6.1
npm http 200 https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/form-data/-/form-data-0.1.0.tgz
npm http GET https://registry.npmjs.org/commander/-/commander-0.6.1.tgz
npm http GET https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz
npm http 200 https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/qs/-/qs-0.6.5.tgz
npm http 200 https://registry.npmjs.org/diff/1.0.2
npm http GET https://registry.npmjs.org/diff/-/diff-1.0.2.tgz
npm http 200 https://registry.npmjs.org/growl
npm http GET https://registry.npmjs.org/growl/-/growl-1.7.0.tgz
npm http 200 https://registry.npmjs.org/ms/0.3.0
npm http 200 https://registry.npmjs.org/debug
npm http 200 https://registry.npmjs.org/ansi-styles/-/ansi-styles-0.2.0.tgz
npm http GET https://registry.npmjs.org/ms/-/ms-0.3.0.tgz
npm http GET https://registry.npmjs.org/debug/-/debug-0.7.2.tgz
npm http 200 https://registry.npmjs.org/has-color/-/has-color-0.1.1.tgz
npm http 200 https://registry.npmjs.org/glob/3.2.1
npm http GET https://registry.npmjs.org/glob/-/glob-3.2.1.tgz
npm http 200 https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.0.tgz
npm http 200 https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz
npm http 200 https://registry.npmjs.org/jade/0.26.3
npm http GET https://registry.npmjs.org/jade/-/jade-0.26.3.tgz
npm http 200 https://registry.npmjs.org/inherits/-/inherits-2.0.0.tgz
npm http 200 https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz
npm http 200 https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz
npm http 200 https://registry.npmjs.org/fstream/-/fstream-0.1.24.tgz
npm http 200 https://registry.npmjs.org/aws-sign/-/aws-sign-0.3.0.tgz
npm http 200 https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz
npm http 200 https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz
npm http 200 https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz
npm http 200 https://registry.npmjs.org/mime/-/mime-1.2.11.tgz
npm http 200 https://registry.npmjs.org/form-data/-/form-data-0.1.0.tgz
npm http 200 https://registry.npmjs.org/commander/-/commander-0.6.1.tgz
npm http 200 https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz
npm http 200 https://registry.npmjs.org/diff/-/diff-1.0.2.tgz
npm http 200 https://registry.npmjs.org/qs/-/qs-0.6.5.tgz
npm http 200 https://registry.npmjs.org/growl/-/growl-1.7.0.tgz
npm http 200 https://registry.npmjs.org/glob/-/glob-3.2.1.tgz
npm http 200 https://registry.npmjs.org/debug/-/debug-0.7.2.tgz
npm http 200 https://registry.npmjs.org/ms/-/ms-0.3.0.tgz
npm http 200 https://registry.npmjs.org/jade/-/jade-0.26.3.tgz
npm http 200 https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz
npm http 200 https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm http 200 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/rimraf/-/rimraf-2.2.2.tgz
npm http 200 https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.0.tgz
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/cryptiles
npm http 200 https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz
npm http 200 https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz
npm http 200 https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz
npm http 200 https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http 200 https://registry.npmjs.org/mkdirp/0.3.0
npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz
npm http 200 https://registry.npmjs.org/graceful-fs
npm http 200 https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz
npm http GET https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz
npm http 200 https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/boom/-/boom-0.4.2.tgz
npm http 200 https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.4.tgz
npm http 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz
npm http 200 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/minimatch/-/minimatch-0.2.12.tgz
npm http 200 https://registry.npmjs.org/sntp
npm http 200 https://registry.npmjs.org/rimraf/-/rimraf-2.2.2.tgz
npm http 200 https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.0.tgz
npm http GET https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz
npm http 200 https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz
npm http 200 https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz
npm http 200 https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.4.tgz
npm http 200 https://registry.npmjs.org/boom/-/boom-0.4.2.tgz
npm http 200 https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz
npm http 200 https://registry.npmjs.org/minimatch/-/minimatch-0.2.12.tgz
npm http 200 https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz
npm http 200 https://registry.npmjs.org/hoek
npm http 200 https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz
npm http 200 https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz
npm http GET https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz
npm http 200 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/async/-/async-0.2.9.tgz
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 200 https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.2.9.tgz
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 200 https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http 200 https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/lru-cache/-/lru-cache-2.3.0.tgz
npm http 200 https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http 200 https://registry.npmjs.org/delayed-stream/0.0.5
npm http GET https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz
npm http 200 https://registry.npmjs.org/lru-cache/-/lru-cache-2.3.0.tgz
npm http 200 https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz
/usr/local/bin/jpegtran -> /usr/local/lib/node_modules/jpegtran-bin/bin/jpegtran.js

[email protected] postinstall /usr/local/lib/node_modules/jpegtran-bin
node pre-build.js

module.js:340
throw err;
^
Error: Cannot find module '/usr/local/lib/node_modules/jpegtran-bin/pre-build.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
npm ERR! weird error 8
npm ERR! not ok code 0

By searching my system I found the module in 2 places
/usr/lib/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/pre-build.js
/usr/lib/node_modules/jpegtran-bin/pre-build.js

The problem here is they are in /usr/lib/... and not in /usr/local/lib/...

Should I fix something in my own config to get it working ?
Thanks

Error: Cannot find module 'bin-wrapper' when installed as part of Yeoman

I have been using Yeoman and on a Windows 7 machine, I see the error below. Do you know what could be the cause?

$ npm install

npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/karma-phantomjs-launcher
npm http GET https://registry.npmjs.org/karma-jasmine
npm http 304 https://registry.npmjs.org/karma-phantomjs-launcher
npm http 304 https://registry.npmjs.org/karma-jasmine
npm http 304 https://registry.npmjs.org/express

[email protected] postinstall p:\yeoman-master\node_modules\jpegtran-bin
node index.js

module.js:340
throw err;
^
Error: Cannot find module 'bin-wrapper'
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. (p:\yeoman-master\node_modules\jpegtran-bin\index.js:3
:18)
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 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 jpegtran-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 jpegtran-bin
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\nodej
s\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd p:\yeoman-master
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! p:\yeoman-master\npm-debug.log
npm ERR! not ok code 0

The download in lib/install.js do not use npm corporate proxy

The donwload mecanism used in the install script lib/install.js do direct download to ( https://raw.githubusercontent.com/imagemin/*) that do not use corporate npm proxy installed in my company (in this case Sonatype Nexus).

This direct download break somes developpement constraint, that need to be respected in bank or assurance company, like DRP ( Disaster Recovery Plan) or BCP, (Business Continuity Planning).

This change of direct download to npm download mechanism permit in more to accelerate the download for all developper by local caching in the npm corporate registry.

[email protected] postinstall: `node lib/install.js` Exit status 1 on Windows 10 npm

Hello,
Please I have an issu with jpegtran installation on windows 10:

npm install --save jpegtran-bin

> [email protected] postinstall C:\Users\..\node_modules\jpegtran-bin
> node lib/install.js

> internal/child_process.js:298

    throw errnoException(err, 'spawn');
    ^

Error: spawn EPERM
    at exports._errnoException (util.js:873:11)
    at ChildProcess.spawn (internal/child_process.js:298:11)
    at exports.spawn (child_process.js:362:9)
    at C:\Users\hihihi\Documents\MEGA\Web-mobile-dev\mooc-webdev\work-angularjs\conFusion\node_modules\bin-check\index.js:22:12
    at C:\Users\hihihi\Documents\MEGA\Web-mobile-dev\mooc-webdev\work-angularjs\conFusion\node_modules\executable\index.js:27:4
    at FSReqWrap.oncomplete (fs.js:82:15)
 [                ..] / postinstall: info lifecycle [email protected]~postinstall: Failed to exec postinstall scriptnpm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\...\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "jpegtran-bin"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE

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 'node lib/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the jpegtran-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 information on how to open an issue for this project with:
npm ERR!     npm bugs jpegtran-bin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls jpegtran-bin
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\..\npm-debug.log

Please help me to resolv the situation. Thank you.

assembler cannot create object files

I have these installation problems with [email protected],

[email protected] postinstall /Users/xx/yy/sites/projects/gulptest/node_modules/jpegtran-bin
> node lib/install.js

  ⚠ Couldn't execute the `/Users/xx/yy/sites/projects/gulptest/node_modules/jpegtran-bin/vendor/jpegtran` binary. Make sure it has the right permissions.
  ⚠ jpegtran pre-build test failed
  ℹ compiling from source
  ✖ Error: touch configure.ac aclocal.m4 configure Makefile.am Makefile.in && ./configure --disable-shared --prefix="/Users/xx/yy/sites/projects/gulptest/node_modules/jpegtran-bin/vendor" --bindir="/Users/xx/yy/sites/projects/gulptest/node_modules/jpegtran-bin/vendor" && make install
Command failed: ./configure --disable-shared --prefix="/Users/xx/yy/sites/projects/gulptest/node_modules/jpegtran-bin/vendor" --bindir="/Users/xx/yy/sites/projects/gulptest/node_modules/jpegtran-bin/vendor"
configure: error: installation or configuration problem: assembler cannot create object files.

    at ChildProcess.exithandler (child_process.js:211:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:885:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)

What can I do?

jpegtran Build Fails ...

When I try to install gulp-imagemin (OS X 10.7.5), I get the following jpegtran-bin build error. Any ideas? Thanks, Chris

[email protected] postinstall /Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin
node lib/install.js
⚠ The /Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor/jpegtran binary doesn't seem to work correctly
⚠ jpegtran pre-build test failed
ℹ compiling from source
✖ Error: touch configure.ac aclocal.m4 configure Makefile.am Makefile.in && ./configure --disable-shared --prefix="/Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor" --bindir="/Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor" && make install
Command failed: /bin/sh -c ./configure --disable-shared --prefix="/Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor" --bindir="/Users/simspace/Webdev/learn-gulp/node_modules/jpegtran-bin/vendor"
configure: error: installation or configuration problem: assembler cannot create object files.

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Socket. (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)

postinstall test failures as part of grunt-contrib-imagemin install

I'm trying to generate an angularjs project (ala https://github.com/hmalphettes/yeoman-angular-express-example) and see the following issue running npm install - please let me know if you need more info to reproduce.

> [email protected] postinstall .../node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin
> node pre-build.js


  1) jpegtran should return path to jpegtran binary
  2) jpegtran should successfully proxy jpegtran
  3) jpegtran should minify a .jpg
  4) jpegtran "after all" hook

  ✖ 4 of 3 tests failed:

  1) jpegtran should return path to jpegtran binary:

  AssertionError: false == true
      at .../node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-jpegtran-path.js:18:4
      at ChildProcess.exithandler (child_process.js:636:7)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:730:16)
      at Process.ChildProcess._handle.onexit (child_process.js:797:5)

  2) jpegtran should successfully proxy jpegtran:

  AssertionError: false == true
      at .../node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-jpegtran-path.js:27:4
      at ChildProcess.exithandler (child_process.js:630:7)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:730:16)
      at Process.ChildProcess._handle.onexit (child_process.js:797:5)

  3) jpegtran should minify a .jpg:
     Error: ENOENT, no such file or directory 'test/minified.jpg'
      at Object.fs.statSync (fs.js:684:18)
      at .../node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-jpegtran-path.js:42:20
      at ChildProcess.exithandler (child_process.js:630:7)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:730:16)
      at Process.ChildProcess._handle.onexit (child_process.js:797:5)

  4) jpegtran "after all" hook:
     Error: ENOENT, no such file or directory 'test/minified.jpg'
      at Object.fs.unlinkSync (fs.js:760:18)
      at Context.<anonymous> (.../node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-jpegtran-path.js:11:6)
      at Hook.Runnable.run (.../node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runnable.js:213:32)
      at next (.../node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runner.js:243:10)
      at Object._onImmediate (.../node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runner.js:254:5)
      at processImmediate [as _immediateCallback] (timers.js:317:15)


libjpeg-turbo rebuilt successfully

Note: 4 of 3 tests failed seems to be caused by the failure in the cleanup part.

$ yo --version && echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)'
1.0.0-beta.4
.../.rvm/gems/ruby-1.9.3-p385@compass/bin:.../.rvm/gems/ruby-1.9.3-p385@global/bin:.../.rvm/rubies/ruby-1.9.3-p385/bin:.../.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin:/usr/local/share/npm/bin /usr/local/lib/node_modules
darwin { http_parser: '1.0',
  node: '0.10.4',
  v8: '3.14.5.8',
  ares: '1.9.0-DEV',
  uv: '0.10.4',
  zlib: '1.2.3',
  modules: '11',
  openssl: '1.0.1e' }
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
  return connect.static(require('path').resolve(dir));
};

alpine-node:4, npm install > Error: not implemented

> [email protected] postinstall /tmp/git-resource-destination.JfGPDb/node_modules/jpegtran-bin
> node lib/install.js

/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_transform.js:159
  throw new Error('not implemented');
  ^

Error: not implemented
    at Transform._transform (/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_transform.js:159:9)
    at Transform._read (/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Transform._write (/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_writable.js:238:10)
    at writeOrBuffer (/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_writable.js:228:5)
    at Transform.Writable.write (/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_writable.js:195:11)
    at write (/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_readable.js:605:24)
    at flow (/tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_readable.js:614:7)
    at /tmp/git-resource-destination.JfGPDb/node_modules/readable-stream/lib/_stream_readable.js:582:7
    at nextTickCallbackWith0Args (node.js:436:9)
npm WARN optional dep failed, continuing [email protected]

Undocumented dependency on Netwide Assembler on Ubuntu, NodeJS v0.8.14

Installing jpegtran-bin results with the following message:
$ npm install jpegtran-bin

> [email protected] postinstall /home/bogdanbiv/tmp/nasm-test/node_modules/jpegtran-bin
> node build.js

{ [Error: Command failed: configure: error: no nasm (Netwide Assembler) found
] killed: false, code: 1, signal: null }

OS: Ubuntu 12.10 64bit, kernel 3.5.0-26-generic;
NPM 1.1.65, NodeJS: v0.8.14
Other OS & node configurations are untested

Default to precompiled binary on OS X

Since the precompiled binary on OS X should support 10.7+ and compiling takes some time, which is most likely unnecessary too. I think it makes sense to test the precompiled binary and if it works just use that and if not, fall back to compiling.

This applies to both jpegtran and optipng, but jpegtran is the slowest.

@Badunk what do you think? would you be interested in doing a PR?

// @passy

Can't install on Mac OSX

I know this was working last week. But I had a problem today, when trying to set up a new Yeoman project. Seems like the jpegtran installation is broken now. Here's the output I ran on my Mac. Thanks.

GCC109848:yeoman_play2 gbl1str$ npm install jpegtran-bin
npm http GET https://registry.npmjs.org/jpegtran-bin
npm http 304 https://registry.npmjs.org/jpegtran-bin
npm http GET https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/mocha
npm http 304 https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/mocha
npm http 304 https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/commander/0.6.1
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/diff/1.0.2
npm http GET https://registry.npmjs.org/debug
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/growl
npm http 304 https://registry.npmjs.org/jade/0.26.3
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm WARN package.json [email protected] No README.md file found!
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/mkdirp/0.3.3
npm http 304 https://registry.npmjs.org/ms/0.3.0
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/gbl1str/Code/node_modules/jpegtran-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:362:17)
at require (module.js:378:17)
at Object. (/Users/gbl1str/Code/node_modules/jpegtran-bin/pre-build.js:4:13)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
npm ERR! [email protected] postinstall: node pre-build.js
npm ERR! sh "-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 jpegtran-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 jpegtran-bin
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "jpegtran-bin"
npm ERR! cwd /Users/gbl1str/Code/yeoman_play2
npm ERR! node -v v0.8.9
npm ERR! npm -v 1.1.61
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/gbl1str/Code/yeoman_play2/npm-debug.log
npm ERR! not ok code 0

install should not fail silently

We've had an issue today where our CI build failed silently because jpegtran-bin failed to install as a result of a 504:

> [email protected] postinstall /src/node_modules/jpegtran-bin
> node lib/install.js

  ⚠ spawn /src/node_modules/jpegtran-bin/vendor/jpegtran ENOENT
  ⚠ jpegtran pre-build test failed
  ℹ compiling from source
  ✖ HTTPError: Response code 504 (Gateway Time-out)
    at EventEmitter.<anonymous> (/src/node_modules/got/index.js:197:24)
    at emitOne (events.js:96:13)
    at EventEmitter.emit (events.js:188:7)
    at Immediate.<anonymous> (/src/node_modules/got/index.js:63:8)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

As a result, our service was stuck in a death loop. It would be far preferable if install.js did a process.exit(1) or re-throw rather than simply return.

Can't install on windows behind a proxy

This module once work in the old version, but it doesn't work after I upgrade to the latest one. After investigating, it seems the library 'download' doesn't support proxy any more.

'

Install error, affects pngquant-bin as well

Getting the same error for both packages, both were installing fine yesterday however not anymore today (I didn't change any deps).

> [email protected] postinstall /.../node_modules/jpegtran-bin
> node lib/install.js

module.js:341
    throw err;
    ^

Error: Cannot find module './src/init'

v1.3.1 binary

  • freebsd
  • linux x64
  • linux x86
  • osx
  • sunos x64
  • sunos x86
  • win x64
  • win x86

Since v0.2.1: "building is not supported on win32"

No problems in v0.2.0 but when npm installing v0.2.1 I get an error:
(Windows 8.1, 64bit, and CI servers)


  libjpeg-62.dll: downloading [====               ] 23% 0.5s✗ pre-build test fai
led, compiling from source...

C:\Projects\Rijksmuseum.PaintSampleApp\src\client\node_modules\grunt-contrib-ima
gemin\node_modules\jpegtran-bin\lib\check.js:19
                        throw new Error('building is not supported on ' + proces
s.platform);
                              ^
Error: building is not supported on win32
    at C:\Projects\Rijksmuseum.PaintSampleApp\src\client\node_modules\grunt-cont
rib-imagemin\node_modules\jpegtran-bin\lib\check.js:19:10
    at ChildProcess.<anonymous> (C:\Projects\Rijksmuseum.PaintSampleApp\src\clie
nt\node_modules\grunt-contrib-imagemin\node_modules\jpegtran-bin\node_modules\bi
n-wrapper\bin-wrapper.js:168:16)
    at ChildProcess.EventEmitter.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:787:12)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'C:\Projects\Rijksmuseum.Pai
ntSampleApp\src\client\node_modules\grunt-contrib-imagemin\node_modules\optipng-
bin\node_modules\bin-wrapper\node_modules\mout\src\lang'
npm ERR! error rolling back  [email protected] { [Error: ENOTEMPTY, r
mdir 'C:\Projects\Rijksmuseum.PaintSampleApp\src\client\node_modules\grunt-contr
ib-imagemin\node_modules\optipng-bin\node_modules\bin-wrapper\node_modules\mout\
src\lang']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: 'C:\\Projects\\Rijksmuseum.PaintSampleApp\\s
rc\\client\\node_modules\\grunt-contrib-imagemin\\node_modules\\optipng-bin\\nod
e_modules\\bin-wrapper\\node_modules\\mout\\src\\lang' }
npm ERR! weird error 8
npm ERR! Error: ENOENT, lstat 'C:\Projects\Rijksmuseum.PaintSampleApp\src\client
\node_modules\grunt-contrib-imagemin\node_modules\optipng-bin\node_modules\bin-w
rapper\node_modules\mout\src\lang\createObject.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Projects\Rijksmuseum.PaintSampleApp\src\client
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! path C:\Projects\Rijksmuseum.PaintSampleApp\src\client\node_modules\gru
nt-contrib-imagemin\node_modules\optipng-bin\node_modules\bin-wrapper\node_modul
es\mout\src\lang\createObject.js
npm ERR! fstream_path C:\Projects\Rijksmuseum.PaintSampleApp\src\client\node_mod
ules\grunt-contrib-imagemin\node_modules\optipng-bin\node_modules\bin-wrapper\no
de_modules\mout\src\lang\createObject.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack c:\Program Files\nodejs\node_modules\npm\node_modules\fst
ream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Projects\Rijksmuseum.PaintSampleApp\src\client\npm-debug.log
npm ERR! not ok code 0

Installing behind proxy fails

Hello,

It seems like version 3.0.5 is failing to fetch the jpegtran binary when behind a proxy, although it was working recently. Forcing the version to be 3.0.4 fixes the issue, therefore the problem exists in 3.0.5.
The proxy is being set through environment variables.

Not working

var execFile = require('child_process').execFile;
var jpegtran = require('jpegtran-bin');


//gulp jpgmin
gulp.task('jpgmin', function() {
    return execFile(jpegtran, ['-min', 'build/img/', 'src/img/**/*.jpg'], function (err) {
        console.log('Image minified!');
    });
});

executable perm not set pm installed jpegtran-bin/vendor/jpegtran binary

With prereqs installed

yarn add --dev \
 bin-build@^3.0 \
 jpegtran-bin@^3.0

attempt to install jpegtran

yarn add --dev jpegtran@^1.0

fails

yarn add v0.24.6
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⠐ jpegtran-bin:   ℹ compiling from source
[-/1] ⠐ waiting...
[-/1] ⠐ waiting...
[-/1] ⠐ waiting...
error /test/node_modules/jpegtran/node_modules/jpegtran-bin: Command failed.
Exit code: 1
Command: sh
Arguments: -c node lib/install.js
Directory: /test/node_modules/jpegtran/node_modules/jpegtran-bin
Output:
⚠ Couldn't execute the `/test/node_modules/jpegtran/node_modules/jpegtran-bin/vendor/jpegtran` binary. Make sure it has the right permissions.
  ⚠ jpegtran pre-build test failed
  ℹ compiling from source
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1167:7)
    at mkdirp (/test/node_modules/fs-mkdirp-stream/mkdirp.js:17:18)
    at onDirpath (/test/node_modules/fs-mkdirp-stream/index.js:31:9)
    at dirpath (/test/node_modules/vinyl-fs/lib/dest/index.js:26:5)
    at DestroyableTransform.makeFileDirs [as _transform] (/test/node_modules/fs-mkdirp-stream/index.js:24:7)
    at DestroyableTransform.Transform._read (/test/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at DestroyableTransform.Transform._write (/test/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/test/node_modules/readable-stream/lib/_stream_writable.js:405:64)
    at writeOrBuffer (/test/node_modules/readable-stream/lib/_stream_writable.js:394:5)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

checking perms

ls -al /test/node_modules/jpegtran/node_modules/jpegtran-bin/vendor/
	total 308K
	drwxr-x---+ 2 root root 4.0K Jun 26 09:49 ./
	drwxr-x---+ 5 root root 4.0K Jun 26 09:49 ../
	-rw-rw----+ 1 root root 299K Jun 26 09:49 jpegtran

fixing perms

chmod +x /test/node_modules/jpegtran/node_modules/jpegtran-bin/vendor/jpegtran

now install works

yarn add --dev jpegtran@^1.0

	yarn add v0.24.6
	[1/4] Resolving packages...
	[2/4] Fetching packages...
	[3/4] Linking dependencies...
	[4/4] Building fresh packages...
	success Saved lockfile.
	success Saved 4 new dependencies.
	├─ [email protected]
	├─ [email protected]
	├─ [email protected]
	└─ [email protected]
	Done in 4.86s.

i want to instll,this error

⚠ The jpegtran binary doesn't seem to work correctly
⚠ jpegtran pre-build test failed
ℹ compiling from source

✖ Error: CFLAGS="-m32" LDFLAGS="-m32" ./configure --disable-shared --prefix="/Users/Lennon/kevin/app/jpegtran/node_modules/jpegtran-bin/vendor" --bindir="/Users/Lennon/kevin/app/jpegtran/node_modules/jpegtran-bin/vendor" && make install
Command failed: /bin/sh -c CFLAGS="-m32" LDFLAGS="-m32" ./configure --disable-shared --prefix="/Users/Lennon/kevin/app/jpegtran/node_modules/jpegtran-bin/vendor" --bindir="/Users/Lennon/kevin/app/jpegtran/node_modules/jpegtran-bin/vendor"

configure: error: C compiler cannot create executables
See `config.log' for more details.

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

install fails when cwd contains spaces

Fails:

mkdir foo\ bar
cd foo\ bar
npm install jpegtran-bin

Works:

mkdir foo_bar
cd foo_bar
npm install jpegtran-bin

I'm on Ubuntu 12.10, 32bit.

It's actually the pre-build.js test suite that bites it, with no spaces in my pathname the pre-build tests all pass. With spaces in cwd the tests fail and it goes on to try building libjpeg-trubo (which also fails... even after installing nasm).

mozjpeg

mozjpeg is a fork of libjpeg-turbo which we use here. The goal is to compress even better. We should evaluate it when it matures.

Compilation fails

We are using gulp-imagemin but this issue is related exactly to jpegtran. We have a build system running in docker container and base on node:alpine, recently it started to fail. The minimal case to replicate the problem.

  1. docker run -it node:alpine /bin/sh
    Install some build dependencies
  2. apk add --update --no-cache make g++ automake autoconf libtool nasm libjpeg-turbo-dev
  3. npm install jpegtran-bin

We get following output that is worth mentioning

[email protected] postinstall /node_modules/jpegtran-bin
node lib/install.js
spawn /node_modules/jpegtran-bin/vendor/jpegtran ENOENT
jpegtran pre-build test failed
compiling from source
Error: touch configure.ac aclocal.m4 configure Makefile.am Makefile.in && ./configure --disable-shared --prefix="/node_modules/jpegtran-bin/vendor" --bindir="/node_modules/jpegtran-bin/vendor" && make install
Command failed: ./configure --disable-shared --prefix="/node_modules/jpegtran-bin/vendor" --bindir="/node_modules/jpegtran-bin/vendor"
/bin/sh: ./configure: Permission denied

    at ChildProcess.exithandler (child_process.js:270:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Socket.stream.socket.on (internal/child_process.js:348:11)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at Pipe._handle.close [as _onclose] (net.js:545:12)

Previously it was running ok on the same build system. I can't say exactly when it first started to fail as I was using cache and I have noticed the problem after cleaning the cache.

install fails on RedHat EL5

I first got the same issues as yeoman/node-jpegtran-bin#9, but installed it using

$ sudo yum install nasm

Then I got the following error:

/var/lib/jenkins/jobs/plove/workspace/plove/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/build.js:78
                            throw err;
                                  ^
Error: Command failed: configure: error: installation or configuration problem: assembler cannot create object files.

    at ChildProcess.exithandler (child_process.js:540:15)
    at ChildProcess.EventEmitter.emit (events.js:99:17)
    at maybeClose (child_process.js:638:16)
    at Process._handle.onexit (child_process.js:680:5)
npm ERR! [email protected] postinstall: `node pre-build.js`
npm ERR! `sh "-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 jpegtran-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 jpegtran-bin
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.18-308.4.1.el5
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /var/lib/jenkins/jobs/plove/workspace/plove
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!     /var/lib/jenkins/jobs/plove/workspace/plove/npm-debug.log
npm ERR! not ok code 0

For now I have removed the imagemin dep.

npm install fails on win64 due to jpegtran.exe --help returning errorcode 1

Hi,

I'm unable to install jpegtran-bin (Windows 7, 64-bit). The output looks like this:

npm install imagemin-jpegtran
\

[email protected] postinstall C:\Dev\rm\2\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin
node lib/install.js

‼ pre-build test failed, compiling from source...
× { [Error: Command failed: '.' is not recognized as an internal or external command,
operable program or batch file.
] killed: false, code: 1, signal: null }
[email protected] node_modules\imagemin-jpegtran
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])

I did some investigation, and it looks like the binary, when executed with --help (as it takes place in jpegtran-bin\node_modules\bin-wrapper\node_modules\bin-check\index.js) returns code 1:

C:\Dev\rm\1\node_modules\imagemin-jpegtran\node_modules\jpegtran-bin\vendor\jpegtran.exe --help
echo %errorlevel%

1

However, the .exe file executes correctly and displays help.

I use node 0.10.31 and npm 1.4.23.

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.

Can't install on Win 7 64 bits (can't download jpegtran.exe)

I'm trying to install jpegtran-bin by doing:
npm cache clean -f
npm install jpegtran-bin

The error I get is:

npm info postinstall [email protected]

> [email protected] postinstall C:\a\node_modules\jpegtran-bin
> node lib/install.js

  ‼ ENOENT, stat 'C:\a\node_modules\jpegtran-bin\vendor\jpegtran.exe'
  ‼ jpegtran pre-build test failed
  i compiling from source
  × Error: Command failed: '.' is not recognized as an internal or external comm
and,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Checking my vendor folder it seems the file win/x64/jpegtran.exe isn't downloaded, I only have "libjpeg-62.dll" but I can't see any error even using -ddd switch. I've disabled antivirus and stuff like that and I tried over 2 networks with no luck...

Is there anything I can do to get more log or understand this better?

Update bin-build dependency

Hi,

This might have been posted somewhere else, but I'll post here just to be sure.

snyk is complaining about a vulnerability in tunnel-agent that jpegtran-bin is dependent on. The issue was fixed in tunnel-agent, but jpegtran-bin still seems to use an old version. caw, download and bin-build seems to have been updated.

snyk output:

✗ Medium severity vulnerability found on [email protected]
- desc: Uninitialized Memory Exposure
- info: https://snyk.io/vuln/npm:tunnel-agent:20170305
- from: [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected]
No direct dependency upgrade can address this issue.
Run `snyk wizard` to explore remediation options.

✗ Medium severity vulnerability found on [email protected]
- desc: Uninitialized Memory Exposure
- info: https://snyk.io/vuln/npm:tunnel-agent:20170305
- from: [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected]
No direct dependency upgrade can address this issue.
Run `snyk wizard` to explore remediation options.

✗ Medium severity vulnerability found on [email protected]
- desc: Uninitialized Memory Exposure
- info: https://snyk.io/vuln/npm:tunnel-agent:20170305
- from: [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected]
No direct dependency upgrade can address this issue.
Run `snyk wizard` to explore remediation options.

✗ Medium severity vulnerability found on [email protected]
- desc: Uninitialized Memory Exposure
- info: https://snyk.io/vuln/npm:tunnel-agent:20170305
- from: [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected]
No direct dependency upgrade can address this issue.
Run `snyk wizard` to explore remediation options.

✗ Medium severity vulnerability found on [email protected]
- desc: Uninitialized Memory Exposure
- info: https://snyk.io/vuln/npm:tunnel-agent:20170305
- from: [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected]
No direct dependency upgrade can address this issue.
Run `snyk wizard` to explore remediation options.

✗ Medium severity vulnerability found on [email protected]
- desc: Uninitialized Memory Exposure
- info: https://snyk.io/vuln/npm:tunnel-agent:20170305
- from: [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected]
No direct dependency upgrade can address this issue.
Run `snyk wizard` to explore remediation options.

Only the top one is relevant for this issue, but the others are also relevant for imagemin so I included that too. I also know that this can't be exploited in production, but I might as well report it.

"binary doesn't seem to work properly"

We are having really slow build times (from a clean workspace) because imagemin is trying to install all these dependencies and they are all giving us a "binary doesn't seem to work properly" error, so it tries to compile all of them (which adds about 4-5 minutes to our build time). We are using linux 64bit, and there seems to be a pre-built binary for that which we were hoping to be able to get to work, but we've had no luck so far. This is our system:

$uname -ar 
Linux myhost 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux

Is there any way to get all these jpegtran-bin, gifsicle-bin etc libraries to use the binary installed in our $PATH or feed them a prebuilt binary that we know works?

I've tried looking at the source code and from what I understand, they are all using bin-wrapper and using the binaries on /vendor, so I figured it might be possible to try to load one from the $PATH adding a line here https://github.com/imagemin/jpegtran-bin/blob/master/lib/index.js#L18. Not sure if there's a valid reason against it, so I'd rather ask before trying to modify all the libraries.

4 of 3 tests failed on Mac OS X

In Debian everything works fine but in Mac OS X fails:

albeniz:myproject agustin$ npm cache clean
albeniz:myproject agustin$ npm install git://github.com/yeoman/node-jpegtran-bin.git
npm http GET https://registry.npmjs.org/mocha
...
npm http 200 https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz

> [email protected] postinstall /Users/agustin/Development/git/learningjs/myproject/node_modules/jpegtran-bin
> node pre-build.js

  1) jpegtran should return path to jpegtran binary
  2) jpegtran should successfully proxy jpegtran
  3) jpegtran should minify a .jpg
  4) jpegtran "after all" hook

  ✖ 4 of 3 tests failed:
...
npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "git://github.com/yeoman/node-jpegtran-bin.git"
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.18

I have same versions of npm and node in both machines. Please, let me know if you need more info. Also note the "4 of 3" tests failed instead of "4 of 4" tests failed.
Thanks.

Installation problem

> [email protected] postinstall /Users/soswow/Work/test-app/node_modules/jpegtran-bin
> node build.js


module.js:340
    throw err;
          ^
Error: Cannot find module '/Users/soswow/Work/test-app/node_modules/jpegtran-bin/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:244:9)
npm ERR! [email protected] postinstall: `node build.js`
npm ERR! `sh "-c" "node 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 jpegtran-bin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls jpegtran-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.8.21/bin/node" "/usr/local/bin/npm" "install" "jpegtran-bin"
npm ERR! cwd /Users/soswow/Work/test-app
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/soswow/Work/test-app/npm-debug.log
npm ERR! not ok code 0

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.