node-imagemagick-native icon indicating copy to clipboard operation
node-imagemagick-native copied to clipboard

Can't install on OSX

Open aleclarson opened this issue 8 years ago • 7 comments

On OSX v10.10.4, I've tried npm install imagemagick-native on:

  • io.js v3.0.0
  • io.js v1.6.2
  • NodeJS v0.12.4
  • NodeJS v0.10.36

What should I do? :smile:

terminal output

> [email protected] install /path/to/package/node_modules/imagemagick-native
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
/usr/local/bin/Magick++-config: line 53: pkg-config: command not found
/usr/local/bin/Magick++-config: line 56: pkg-config: command not found
gyp: Call to 'Magick++-config --ldflags --libs' returned exit status 0. 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 (/Users/me/.nvm/versions/io.js/v1.6.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:169:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1044:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "/Users/me/.nvm/versions/io.js/v1.6.2/bin/iojs" "/Users/me/.nvm/versions/io.js/v1.6.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /path/to/package/node_modules/imagemagick-native
gyp ERR! node -v v1.6.2
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Darwin 14.4.0
npm ERR! argv "/Users/me/.nvm/versions/io.js/v1.6.2/bin/iojs" "/Users/me/.nvm/versions/io.js/v1.6.2/bin/npm" "i" "--save" "mash/node-imagemagick-native"
npm ERR! node v1.6.2
npm ERR! npm  v2.7.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the imagemagick-native 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 imagemagick-native
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /path/to/package/npm-debug.log

npm-debug.log

Link here

aleclarson avatar Aug 07 '15 09:08 aleclarson

This is your problem:

/usr/local/bin/Magick++-config: line 53: pkg-config: command not found
/usr/local/bin/Magick++-config: line 56: pkg-config: command not found

This module (node-imagemagick-native) is a binding for the native (C++) ImageMagick library. You must first have that installed, for example using brew etc.

elad avatar Aug 07 '15 10:08 elad

I did do that. But it's still not working.

If I try brew install imagemagick, it outputs Warning: imagemagick-6.9.1-1 already installed.

Perhaps it's installing in the wrong location?

Here's the output after running brew uninstall imagemagick and then brew install imagemagick again.

aleclarson avatar Aug 08 '15 00:08 aleclarson

Sorry for not being clear! When I said "the library" I meant the stuff usually packaged for developers - that is, not only the shared library but also the headers etc. To the best of my knowledge, this isn't part of the standard ImageMagick package, which only includes the runtime for using the software itself.

(By being a native binding, node-imagemagick-native actually uses the same interfaces as ImageMagick itself rather than invoking the binary.)

elad avatar Aug 08 '15 11:08 elad

So I shouldn't be using brew install imagemagick?

Or do I need to install something else entirely?

Thanks for the replies! :smile:

aleclarson avatar Aug 09 '15 03:08 aleclarson

Hm, maybe it's related to #95 then. I'll have to find a time to look more into it.

elad avatar Aug 09 '15 08:08 elad

I don't know if this has been resolved but I have had the same issue recently. The way I fixed it was to link to the directory that contains the pkg-config in the PKG_CONFIG_PATH.

The following steps outline how this is achieved:

  1. Find the location of your pkg-config folder for imagemagick, to do this I ran the command locate Magick++.pc, make a note of this, mine was /usr/local/lib/pkgconfig
  2. vi ~/.bash_profile
  3. Add the following line to the end of the file export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH, edit for your package folder.
  4. Save and exit the file
  5. You now need to load in the changes: source ~/.bash_profile
  6. Try the installation again. I found that the only way I could install it after this was to use the github URL git://github.com/mash/node-imagemagick-native.git, not sure why.

I hope this helps.

interbred-monkey avatar Oct 22 '15 09:10 interbred-monkey

/usr/local/bin/Magick++-config: line 53: pkg-config: command not found
/usr/local/bin/Magick++-config: line 56: pkg-config: command not found

Isn't this output complaining about not finding "pkgconfig" and not about "imagemagick"?

So how about doing sudo brew install pkgconfig?

erhhung avatar Feb 09 '16 22:02 erhhung