mozjpeg pre-build test failed

OS X 10.13.1

nasm -v

NASM version 0.98.40 (Apple Computer, Inc. build 11) compiled on Oct 11 2017

执行 npm install后发现控制台出现如下信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mozjpeg@4.1.1 postinstall /Applications/XAMPP/xamppfiles/htdocs/bright-cms/node_modules/mozjpeg
node lib/install.js

⚠ The `/Applications/XAMPP/xamppfiles/htdocs/bright-cms/node_modules/mozjpeg/vendor/cjpeg` binary doesn't seem to work correctly
⚠ mozjpeg pre-build test failed
ℹ compiling from source
✖ Error: autoreconf -fiv && ./configure --disable-shared --prefix="/Applications/XAMPP/xamppfiles/htdocs/bright-cms/node_modules/mozjpeg/vendor" --bindir="/Applications/XAMPP/xamppfiles/htdocs/bright-cms/node_modules/mozjpeg/vendor" --libdir="/Applications/XAMPP/xamppfiles/htdocs/bright-cms/node_modules/mozjpeg/vendor" && make --jobs=4 && make install --jobs=4
Command failed: autoreconf -fiv
/bin/sh: autoreconf: command not found
at ChildProcess.exithandler (child_process.js:271: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:547:12)

如下是问题解决的链接地址

  1. Update Xcode command line tools to latest release
  2. brew install nasm (I was using the bundled OS X version 0.98.40, now using 2.11.08)
  3. npm cache clean
  4. npm install

注:PNG reference library: libpng

  1. PNG reference library: libpng
  2. Mac下ImageMagick安装(libpng)
  3. Mac环境安装imagemagick
-------------本文结束 感谢您的阅读-------------