Node js + imagemagick + Error: spawn ENOENT

橙三吉。 提交于 2019-12-22 12:39:26

问题


Hi am trying to implement Imagemagick package using node.js

I added my following code.

var im = require('imagemagick');

router.post('/conversation/start', function(req, res) {

    var args = ["/public/images/team/rajini.jpg", "-crop", "120x80+30+15", "output.png"];

    im.convert(args, function(err) {
        if (err) {
            throw err;
        }
        res.end("Image crop complete");
    });
});

But i getting the following error in terminal.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

来源:https://stackoverflow.com/questions/30458167/node-js-imagemagick-error-spawn-enoent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!