Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在节点JS中使用gm模块时,NodeJS产生enoint错误_Node.js_Amazon Ec2_Imagemagick_Graphicsmagick - Fatal编程技术网

Node.js 在节点JS中使用gm模块时,NodeJS产生enoint错误

Node.js 在节点JS中使用gm模块时,NodeJS产生enoint错误,node.js,amazon-ec2,imagemagick,graphicsmagick,Node.js,Amazon Ec2,Imagemagick,Graphicsmagick,我正在用Linux操作系统在AWS EC2实例上使用gm节点模块。我的目标是从S3 bucket裁剪url提供的图像。我正在从S3 bucket对图像url执行http请求以获取缓冲区,并将缓冲区值传递给gm模块。我的代码如下: gm(buffer).crop(width, height, x, y).toBuffer(imageExtension, function (err, buffer) { if (err) { //error

我正在用Linux操作系统在AWS EC2实例上使用gm节点模块。我的目标是从S3 bucket裁剪url提供的图像。我正在从S3 bucket对图像url执行http请求以获取缓冲区,并将缓冲区值传递给gm模块。我的代码如下:

  gm(buffer).crop(width, height, x, y).toBuffer(imageExtension, function (err, buffer) {
            if (err) {
               //error Handling
            } else {
              //Some Logic
            }
    });
当我将缓冲区传递给gm crop模块时,我得到spawn enoint错误

events.js:85
throw err; // Unhandled 'error' event
      ^
Error: spawn convert ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickDomainCallback (node.js:381:11)
我参考了堆栈溢出上的以下链接以供参考,但无法修复错误


  • 有人能帮我解决这个问题吗?

    为了解决这个问题,我参考了以下关于服务器故障的链接

    我在AmazonEC2实例终端上运行了下面给出的命令,服务器上安装了linux体系结构的依赖项,gm节点模块开始正常工作

    sudo yum install GraphicsMagick GraphicsMagick-devel ImageMagick