Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ha error in linux #69

Open
jamlfy opened this issue Feb 6, 2015 · 12 comments
Open

Ha error in linux #69

jamlfy opened this issue Feb 6, 2015 · 12 comments

Comments

@jamlfy
Copy link

jamlfy commented Feb 6, 2015

> imagemagick-native@1.7.0 install /home/pol/Work/node_modules/imagemagick-native
> node-gyp rebuild

/bin/sh: 1: Magick++-config: not found
gyp: Call to 'Magick++-config --ldflags --libs' 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/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-30-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pol/Work/node_modules/imagemagick-native
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! imagemagick-native@1.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
@elad
Copy link
Owner

elad commented Feb 7, 2015

Do you have the native libraries installed? It doesn't look like it...

@jamlfy
Copy link
Author

jamlfy commented Feb 7, 2015

mm ... which are the libraries? I have ImageMagick

@TimWolla
Copy link
Collaborator

TimWolla commented Feb 7, 2015

mm ... which are the libraries? I have ImageMagick

You need the dev libraries (libmagick++-dev for Debian / Ubuntu).

@clemsos
Copy link

clemsos commented Feb 8, 2015

Same problem here (with libmagick++-dev installed) and debian x64 jessie 3.16.0-4-amd64

> imagemagick-native@1.7.0 install /home/clemsos/Dev/clemsos.github.io/node_modules/imagemagick-native
> node-gyp rebuild

/bin/sh: 1: Magick++-config: not found
gyp: Call to 'Magick++-config --ldflags --libs' returned exit status 127.
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/clemsos/.nvm/v0.10.26/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-4-amd64
gyp ERR! command "node" "/home/clemsos/.nvm/v0.10.26/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/clemsos/Dev/clemsos.github.io/node_modules/imagemagick-native
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm ERR! imagemagick-native@1.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the imagemagick-native@1.7.0 install script.
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! System Linux 3.16.0-4-amd64
npm ERR! command "/home/clemsos/.nvm/v0.10.26/bin/node" "/home/clemsos/.nvm/v0.10.26/bin/npm" "install" "imagemagick-native"
npm ERR! cwd /home/clemsos/Dev/clemsos.github.io
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/clemsos/Dev/clemsos.github.io/npm-debug.log
npm ERR! not ok code 0

@clemsos
Copy link

clemsos commented Feb 8, 2015

On Debian Jessie, sudo apt-get install graphicsmagick-libmagick-dev-compat seems to add Magick++-config to the path, but it looks like it will just turn Magick++-config into a link to GraphicsMagick++-config. I don't know C++ really (sorry) but GraphicsMagick is different from ImageMagick so I guess it is why this doesn't work.

clemsos@clemsos:~/Dev/clemsos.github.io$ Magick++-config
Usage: GraphicsMagick++-config [--cppflags] [--cxxflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]

 For example, "example.cpp" may be compiled to produce "example" as follows:

  "c++ -o example example.cpp `GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs`"

Then it won't work neither

clemsos@clemsos:~/Dev/clemsos.github.io$ npm install --save imagemagick-native


> imagemagick-native@1.7.0 install /home/clemsos/Dev/clemsos.github.io/node_modules/imagemagick-native
> node-gyp rebuild

Usage: GraphicsMagick++-config [--cppflags] [--cxxflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]

 For example, "example.cpp" may be compiled to produce "example" as follows:

  "c++ -o example example.cpp `GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs`"
gyp: Call to 'Magick++-config --cflags --cppflags' returned exit status 1.
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/clemsos/.nvm/v0.10.26/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-4-amd64
gyp ERR! command "node" "/home/clemsos/.nvm/v0.10.26/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/clemsos/Dev/clemsos.github.io/node_modules/imagemagick-native
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm ERR! imagemagick-native@1.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the imagemagick-native@1.7.0 install script.
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! System Linux 3.16.0-4-amd64
npm ERR! command "/home/clemsos/.nvm/v0.10.26/bin/node" "/home/clemsos/.nvm/v0.10.26/bin/npm" "install" "--save" "imagemagick-native"
npm ERR! cwd /home/clemsos/Dev/clemsos.github.io
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/clemsos/Dev/clemsos.github.io/npm-debug.log
npm ERR! not ok code 0

@clemsos
Copy link

clemsos commented Feb 8, 2015

Ok, I solved it by doing

sudo apt-get purge graphicsmagick-libmagick-dev-compat

then look for the right lib and install it

clemsos@clemsos:~$ dpkg --search Magick++-config
libmagick++-6.q16-dev:amd64: /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick++-config
clemsos@clemsos:~$ sudo apt-get install libmagick++-6.q16-dev

add to the path and reload bash

clemsos@clemsos:~$ echo "export PATH=/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16:$PATH" >> ~/.bashrc
clemsos@clemsos:~$ source ~/.bashrc

Now it works.

@trueter
Copy link

trueter commented Mar 4, 2015

I'm trying to get this to work on heroku. The best way would be to update this repo, but I don't feel comfortable fixing the compile step myself. Can someone help trying what @clemsos did?
https://github.com/mcollina/heroku-buildpack-imagemagick see bin/compile

Edit:
I found another way by using the gm module using the subClass({imageMagick: true}) option this buildpack: https://github.com/mcollina/heroku-buildpack-graphicsmagick

@qrazi
Copy link

qrazi commented May 11, 2016

On Ubuntu 16.04 I had to use @clemsos solution.... In my previous Ubuntu 14.04 I'm sure I got away with just using libmagick++-dev... :-/

edit: to add to this; @clemsos solution does not actually result in having :$PATH in your bash, but the echo'd version of it. I manually changed it to :$PATH again. Since I'm not that knowledgable about echoing properly into files, I cannot provide an updated version...

@stanleycyang
Copy link

@trueter Did you get it working on heroku?

@tmikaeld
Copy link

This is still an issue on Debian 8, might be a good idea to update the install instructions...

@timendez
Copy link

How would I go about trying what @clemsos wrote with a circle.yml file for Circle ci?

@Spown
Copy link

Spown commented Nov 6, 2017

On Debian Jessie installing the module directly via github:elad/node-imagemagick-native (use -force if from console, without altering package.json) actually yields a proper build. The gyp binding uses pkg-config instead of Magic's config.

This fix was introduced half a year ago and the npm version is over year old now and still uses magic config. I bet the one third of the issues could be closed by now with the fix - they are all build related.

Developers: https://www.youtube.com/watch?v=ZVPolwmpOUo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants