pierreinglebert / node-zopfli

Node bindings for Zopfli Compression Algorithm (zlib, gzip, deflate compatible)
MIT License
110 stars 39 forks source link

node-zopfli package install, but does not run #114

Open faunaee opened 4 years ago

faunaee commented 4 years ago

This is on a MacBook Pro:

$ node --version
v12.16.1
$ npm --version
6.13.4
$ uname -a
Darwin MacbookPro.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64

The install appears to be good:

$ npm i -g node-zopfli
/usr/local/bin/zopflipng -> /usr/local/lib/node_modules/node-zopfli/bin/zopflipng
/usr/local/bin/zopfli -> /usr/local/lib/node_modules/node-zopfli/bin/zopfli

> node-zopfli@2.1.4 install /usr/local/lib/node_modules/node-zopfli
> prebuild-install --runtime napi || prebuild-install || node-gyp rebuild

+ node-zopfli@2.1.4
updated 2 packages in 4.968s
$ zopflipng --version
2.1.4

However, when I try to run:

$ zopflipng test.png test-zopfli.png
/usr/local/lib/node_modules/node-zopfli/bin/zopflipng:49
  zopfli.pngcompress(program.args[0], program.args[1], options);
         ^

TypeError: undefined is not a function
    at Object.<anonymous> (/usr/local/lib/node_modules/node-zopfli/bin/zopflipng:49:10)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
faunaee commented 4 years ago

I get the same error on an Ubuntu box:

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 20.0.4.1 LTS
Release:        20.04
Codename:       focal
$ node --version
v10.19.0
$ npm --version
6.14.4
$ uname -a
Linux desktop 5.4.0-31-generic #35-Ubuntu SMP Thu May 7 20:20:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux