cnpm/cnpmjs.org

Fail to install `imagemin-mozjpeg` and `imagemin-jpegtran` with taobao registry

gudh opened this issue · 2 comments

gudh commented

When I install imagemin-mozjpeg and imagemin-jpegtran with NPM default registry, the install process is smooth

However, when I install with the taobao registry

(you can try it out with following commands)

npm i imagemin-jpegtran --registry=https://registry.npm.taobao.org
npm i imagemin-mozjpeg --registry=https://registry.npm.taobao.org

It fails, again and again

npm i imagemin-mozjpeg

> mozjpeg@7.0.0 postinstall /Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg
> node lib/install.js

  ⚠ connect ECONNREFUSED 0.0.0.0:443
  ⚠ mozjpeg pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c make install -j4
mkdir: /Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share: File exists
mkdir: /Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share/doc: File exists
mkdir: /Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share/doc/mozjpeg: File exists
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make[2]: *** [install-libLTLIBRARIES] Error 64
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

Making install in java
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
Making install in simd
/Applications/Xcode.app/Contents/Developer/usr/bin/make  install-am
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
Making install in md5
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
 ./install-sh -c -d '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor'
 ./install-sh -c -d '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share/doc/mozjpeg'
 ./install-sh -c -d '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share/doc/mozjpeg'
 ./install-sh -c -d '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/include'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   libjpeg.la libturbojpeg.la '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor'
 /usr/bin/install -c -m 644 jerror.h jmorecfg.h jpeglib.h turbojpeg.h '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/include'
 /usr/bin/install -c -m 644 example.c '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share/doc/mozjpeg'
 /usr/bin/install -c -m 644 README.ijg README.md libjpeg.txt structure.txt usage.txt wizard.txt LICENSE.md '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share/doc/mozjpeg'
 ./install-sh -c -d '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/include'
 ./install-sh -c -d '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share/man/man1'
 ./install-sh -c -d '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/pkgconfig'
 /usr/bin/install -c -m 644 jconfig.h '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/include'
libtool: install: /usr/bin/install -c .libs/libjpeg.lai /Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/libjpeg.la
 /usr/bin/install -c -m 644 pkgscripts/libjpeg.pc pkgscripts/libturbojpeg.pc '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/pkgconfig'
 /usr/bin/install -c -m 644 cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 '/Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/vendor/share/man/man1'

    at /Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/bin-build/node_modules/execa/index.js:231:11
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /Users/gudh2/javascript-100-projects/2020-10-15 - 2 sharp/node_modules/mozjpeg/lib/install.js:28:3
npm WARN s@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mozjpeg@7.0.0 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mozjpeg@7.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gudh/.npm/_logs/2020-10-18T22_40_10_528Z-debug.log

I come across this problem because my default registry is the taobao registry, and I fail to install imagemin-mozjpeg again and again, I spent whole day Googling for a solution with no luck

Then I thought to myself, maybe this problem is China specific

Then I change the registry back to default NPM registry, errors are gone, works like charm!

I post this issue so that other Chinese programmers can find it helpful, thanks!

i7eo commented

nice

Using cnpm to install it should worked.

cnpm i imagemin-jpegtran