Error on installation using node 4.x
opened this issue · comments
gyp: Call to 'pkg-config --cflags pHash' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/iojs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jan/Projects/nahody/spice/node_modules/phash-image
gyp ERR! node -v v4.1.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "i" "--save" "phash-image"
npm ERR! node v4.1.0
npm ERR! npm v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! phash-image@3.3.0 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phash-image@3.3.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the phash-image package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls phash-image
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
Sorry din't see this is a fork. Post the issue on master.
This fork should work with Node v4.
The Call to 'pkg-config --cflags pHash' returned exit status 127
message suggests pHash is not installed on this machine, or at least the development headers are not available.
First, the work on your fork is great. Thanks for that.
No. The problem was that pkgconfig was not installed. It's not installed automatically with xcode and xcode command line tools. It must be installed manually.
Your fork differ from origin in that way, that no variables like PKG_CONFIG_PATH and LD_LIBRARY_PATH need to be set. Only phash, imagemagick and pkgconfig, need to be installed. To install libpng and libjpeg is also a good idea. (Using OSX 10.10.5 and XCode 7 using brew for 3thd party libs)
Hope this help others.
I suspect the phash.rb formula in homebrew might need depends_on "pkg-config"
adding to it.
doesn't seem like an issue with this library. i'll take a PR for better installation docs, though