Open igal1c0de4n opened 3 years ago
Ok, I figured out the problem. It's actually quite silly: I run meteor via webstorm with environment variables.
The "Include system environment variables" option is checked, but for some reason the default PATH variable didn't include /usr/local/bin
. Since the identify
symlink is located there it isn't found. After adding this directory to the PATH everything went back to working just as before.
So the real issue here is a wrong or "useless" error message.
Ideally, gm would be logging Unable to locate 'identify' in $PATH
.
Instead, gm fails to run 'identify' but still feeds the buffer into the stdin of the failed process. This results in an EPIPE throw.
Looks like there's error handling in gm code:
proc.on('error', function(err){
if (err.code === 'ENOENT') {
cb(new Error('Could not execute GraphicsMagick/ImageMagick: '+cmd+" this most likely means the gm/convert binaries can't be found"));
} else {
cb(err);
}
});
But this code isn't getting executed when 'identity' isn't found.
Perhaps it's because the loading of buffer
into the new process's stdin causes a stack throw, halting the execution for future events e.g. the on('error')
callback.
I'd imagine the maintainers may want to fix this
I've been using npm gm for years on macos. For a long time gm image processing worked great - until a few days/weeks ago and I can't figure out what broke it. My code:
Recently it started throwing this stack:
GM/IM versions:
I've added/removed/cleaned/reinstalled graphicsmagick and imagemagick. Nothing helps.
Any advice??