使用nodejs+imageMagick图片合成报错记录

如果是报这个错误  

Could not execute GraphicsMagick/ImageMagick: gm "convert" "/www/temp/168823116798750156.png" "-crop" "1277.7596x1679.63794+0+614.89966" "/www/temp/168823116798750156.png" this most likely means the gm/convert binaries can't be found

{
  code: 400,
  msg: '文件生成出错.',
  err: Error: Could not execute GraphicsMagick/ImageMagick: gm "convert" "/www/temp/168823116798750156.png" "-crop" "1277.7596x1679.63794+0+614.89966" "/www/temp/168823116798750156.png" this most likely means the gm/convert binaries can't be found
      at ChildProcess. (/www/zhaos_api/node_modules/.store/[email protected]/node_modules/gm/lib/command.js:249:12)
      at ChildProcess.emit (node:events:513:28)
      at ChildProcess._handle.onexit (node:internal/child_process:289:12)
      at onErrorNT (node:internal/child_process:476:16)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
}

只要在require的地方改一下

var gm = require('gm').subClass({imageMagick: true})

版本不一样写法不一样,真扯淡

你可能感兴趣的:(前端,node.js)