0

node.jsからAmazon S3へアップロードしようとしましたが、このエラーが発生しました。これは、運が悪い、画像マジックがインストールされていて、弾力のあるbeanstalkで実行中のアプリコードは、アプリケーションをawsに移動したときにこのエラーが発生したため、すべての依存関係を開発サーバーと同じにチェックしています。Node.js S3アップローダーの問題

のNode.jsログ

Upload data:tmp/c0005d84e41ec82b4f5ae2b1cbf1c3b8 
{ [Error: Command failed: /bin/sh -c identify -format "name= 
size=%[size] 
format=%m 
colorspace=%[colorspace] 
height=%[height] 
width=%[width] 
orientation=%[orientation] 
" tmp/c0005d84e41ec82b4f5ae2b1cbf1c3b8 
/bin/sh: identify: command not found 
] 
    killed: false, 
    code: 127, 
    signal: null, 
    cmd: '/bin/sh -c identify -format "name=\nsize=%[size]\nformat=%m\ncolorspace=%[colorspace]\nheight=%[height]\nwidth=%[width]\norientation=%[orientation]\n" tmp/c0005d84e41ec82b4f5ae2b1cbf1c3b8' } 

S3アップロードオプション

var client = new upload('XXX', { 

    aws: { 
    path: 'images/', 
    region: 'us-east-1', 
    acl: 'public-read', 
    accessKeyId: 'XXX', 
    secretAccessKey: 'XXXX' 
    }, 

    cleanup: { 
    versions: true, 
    original: false 
    }, 

    original: { 
    awsImageAcl: 'private' 
    }, 

    versions: [{ 
    maxWidth: 1040, 
    format: 'jpg', 
    suffix: '-large', 
    quality: 80 
    },{ 
    maxWidth: 780, 
    suffix: '-medium', 
    format: 'jpg', 
    quality: 80 
    }] 
}); 

アップロードスクリプト

app.post('/profile/upload', mupload.single('avatar'), function (req, res, next) { 


    var data = req.file; 
    console.log("Upload data:" + data.path); 

    client.upload(data.path, {}, function(err, versions, meta) { 
      console.log(err); 
      console.log(meta); 
      console.log("versions data:" + versions); 
      versions.forEach(function(image) { 
        res.end(image.url); 
      }); 


    }); 

})。

答えて

2

これはあなたの問題である:/bin/sh: identify: command not found

プログラムがインストールされていない特定するには、EBインスタンス上のImageMagickをインストールする必要があります。 .ebextensions/packages.configには、

packages: 
    yum: 
    ImageMagick: [] 
関連する問題