imagemin / jpegtran-bin

jpegtran bin-wrapper that makes it seamlessly available as a local dependency
http://libjpeg-turbo.virtualgl.org
MIT License
93 stars 47 forks source link

install should not fail silently #87

Closed dylansmith closed 4 years ago

dylansmith commented 6 years ago

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

> jpegtran-bin@3.0.4 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.

sevaru commented 6 years ago

Similar issue https://github.com/imagemin/pngquant-bin/issues/72

sevaru commented 6 years ago

@kevva , @sindresorhus Could you guys assist with it? Thanks!

blowsie commented 6 years ago

I have a similar issue

> jpegtran-bin@3.2.0 postinstall C:\x\images\node_modules\jpegtran-bin
> node lib/install.js

  ‼ unable to get local issuer certificate
  ‼ jpegtran pre-build test failed
  i compiling from source
  × Error: touch configure.ac aclocal.m4 configure Makefile.am Makefile.in && ./configure --disable-shared --prefix="C:\x\images\node_modules\j
pegtran-bin\vendor" --bindir="C:\x\images\node_modules\jpegtran-bin\vendor" && make install
Command failed: ./configure --disable-shared --prefix="C:\x\images\node_modules\jpegtran-bin\vendor" --bindir="C:\x\images\node_modules\jpegtran-bin\vendor"
'.' is not recognized as an internal or external command,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
npm WARN images@1.0.0 No description
npm WARN images@1.0.0 No repository field.

+ jpegtran-bin@3.2.0
updated 1 package in 14.087s
1000ch commented 4 years ago

Fixed 3f50620.