elad / node-imagemagick-native

ImageMagick's Magick++ bindings for NodeJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MacOS X build issue

tomterl opened this issue · comments

I wrote a small metalsmith plugin, that allows to use node-imagemagick-native to process files in a metalsmith setup.

One of my (perspective) users cannot build node-imagemagick-native. He is on MacOS X -- the error message he gets is

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated. 
make: *** [Release/obj.target/imagemagick/src/imagemagick.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit
(/Users/edward/.nvm/versions/node/v5.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:88:13)
gyp ERR! stack at ChildProcess.emit (events.js:173:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
gyp ERR! System Darwin 16.1.0
gyp ERR! command "/Users/edward/.nvm/versions/node/v5.2.0/bin/node"
               "/Users/edward/.nvm/versions/node/v5.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-   gyp.js" "rebuild"
gyp ERR! cwd /Users/edward/Sites/art/node_modules/imagemagick-native
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
art@1.0.0 /Users/edward/Sites/art └── node-sass@4.2.0
    npm WARN art@1.0.0 No repository field.
    npm ERR! Darwin  16.1.0
    npm ERR! argv "/Users/edward/.nvm/versions/node/v5.2.0/bin/node"
            "/Users/edward/.nvm/versions/node/v5.2.0/bin/npm" "install" "--save" "metalsmith-convert"
    npm ERR! node v5.2.0
    npm ERR! npm v3.8.7
    npm ERR! code ELIFECYCLE
    npm ERR! imagemagick-native@1.9.3 install: node-gyp rebuild
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the imagemagick-native@1.9.3 install script 'node-gyp rebuild'.

The issue is tomterl/metalsmith-convert#16

I don't have a mac to investigate myself

I think the problem may be ImageMagick version. Could you try with ImageMagick 6.x?

@edwardessing can you follow cartuchogls lead and try to downgrade imagemagick and then again to install node-imagemagick-native?

Okay so the problem was with the imagemagick-native package. This was the error i was getting:

Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing Magick++.pc' to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing Magick++.pc' to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
gyp: Call to 'Magick++-config --ldflags --libs' returned exit status 0 while in binding.gyp. while trying to load binding.gyp

I got my genius friend to check it out and he ended up resolving the issue by inputting this:

PKG_CONFIG_PATH=/opt/ImageMagick/lib/pkgconfig npm install --save imagemagick-native

Which worked successfully but sadly I have no idea what it means...

pkg-config is a system that is used to find at build-time information about development-files locations etc - it seems your system is not setup correctly or the ImageMagick installation was somehow incomplete in this regard.