0
votes

I get an error using GM() on my remote server, I think i get an issue when I try to write the file... It works perfectly on my local server...

My code :

gm()
.in('-page', '+0+0')
.in('/var/www/myapp/public/images/instabox.jpg')
.in('-page', '+10+10')
.in(image)
.mosaic()
.minify()
.write(newFileName, function (err) { // newfilename = '/var/www/myapp/public/uploads/mydir/image.jpg'
  if (!err) console.log('done');
  if (err) console.log(err);
  callback();
});

My error :

{ [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }

Response of the issue:

I put back GM on my remote server and it was the issue, GM was not well installed...

check if your app has read/write permission over that area... or run your app with sudoRavi
Check that graphicsmagick is installed on the remote server. Are you able to execute gm on the remote server via a terminal?mscdex
I put back GM on my remote server and it was the issue, GM was not well installed...tonymx227
Put that as a answer, @tonymx227MiniGod