Error: Could not execute GraphicsMagick/ImageMagick: identify "-ping" "-format" "%wx%h"
According to source code for gm, this error happens when spawn
(function to start a process) returns ENOENT
, which is the low-level error for "no entry", meaning the required program was not found in $PATH
for the running node process (I mean it might be present but you still need to check environment of running process).
So it is a simple installation issue of the required components. Local machine has all af them, but not your production machine. You said you have "already uploaded all modules" (I think you mean all npm modules), but that is not enough, the gm
module relies on one of GraphicsMagick or ImageMagick.
Quote from main page for gm:
First download and install GraphicsMagick or ImageMagick.
Probably graphicsmagick / imagemagick is not installed correctly, download GraphicsMagick or download ImageMagick, if your are using Ubuntu, these commands are useful.
sudo add-apt-repository ppa:dhor/myway
sudo apt-get update
sudo apt-get install graphicsmagick
sudo apt-get install imagemagick
and I list a few examples of the identify command here to illustrate its usefulness and ease of use. To get started, lets identify an image in the JPEG format:
$ magick identify rose.jpg
> rose.jpg JPEG 70x46 70x46+0+0 8-bit sRGB 2.36KB 0.000u 0:00.000
Or to get the print size in inches of an image at 72 DPI, use:
$ magick identify -format "%[fx:w/72] by %[fx:h/72] inches" document.png
> 8.5 x 11 inches
You can find more options and information from this link.