0

Versucht, von node.js zu Amazon S3 zu laden, diesen Fehler zu bekommen, verbrachte ich den ganzen Tag, um einen Fehler zu finden Glück, Bild Magie installiert, App auf elastischen Bohnenstange, zuvor auf dem Entwicklungsserver installiert und code funktioniert gerade gut, wenn ich die Anwendung zu aws verschiebe, verursacht diesen Fehler ich prüfte alle Abhängigkeiten sein selbe wie Entwicklungs-Server.Node.js S3-uploader Problem

Node.js Log

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 Upload-Optionen

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 
    }] 
}); 

hochladen Script

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); 
      }); 


    }); 

});

Antwort

2

das ist Ihr Problem: /bin/sh: identify: command not found

mit dem Programm verbundenen nicht installiert ist, müssen Sie ImageMagick auf der EB-Instanz installieren. Fügen Sie in Ihrer .extenxtensions/packages.config

packages: 
    yum: 
    ImageMagick: [] 
hinzu
Verwandte Themen