Firebase Cloud Function错误以生成缩略图:spawn convert ENOENT

时间:2018-10-27 10:09:43

标签: firebase imagemagick google-cloud-functions imagemagick-convert spawn

在更新之前,云功能运行良好。这是现在发生错误的代码:

return spawn('convert' ,[tempLocalFile, '-thumbnail', `${THUMB_MAX_WIDTH}x${THUMB_MAX_HEIGHT}`, tempLocalThumbFile], {capture: ['stdout', 'stderr']});

以下是错误的详细信息:

generateThumbnail Error: { 
     Error: spawn convert ENOENT at _errnoException 
     (util.js:1022:11) at Process.ChildProcess._handle.onexit 
     (internal/child_process.js:190:19) at onErrorNT 
     (internal/child_process.js:372:16) at _combinedTickCallback 
     (internal/process/next_tick.js:138:11) at process._tickDomainCallback 
     (internal/process/next_tick.js:218:9) 
     code: 'ENOENT', 
     errno: 'ENOENT', 
     syscall: 'spawn convert', 
     path: 'convert', 
     spawnargs: [ 
          '/tmp/images/E32NIXQKgVUxjUGDmPkr_aaaa', 
          '-thumbnail', 
          '400x220', 
          '/tmp/images/thumb_E32NIXQKgVUxjUGDmPkr_aaaa' 
     ] 
}

我是在做错什么还是Firebase云错误?

1 个答案:

答案 0 :(得分:0)

对于本地开发:brew install imagemagick