错误:使用ImageMagick

时间:2016-11-11 15:23:03

标签: javascript node.js imagemagick gulp-imagemin node-imagemagick

我在上传图片时发现以下错误。

  

" showStack":false," stack":"错误:错误:在完成时产生EACCES \ n   (/var/www/projects/mywebsite/dist/node_modules/gulp-gm/index.js:40:21)\n   在gm。   (/var/www/projects/mywebsite/dist/node_modules/gulp-image-resize/node_modules/async/lib/async.js:485:30)\n   在emitMany(events.js:127:13)\ n at gm.emit(events.js:201:7)\ n
  在gm。   (/var/www/projects/mywebsite/dist/node_modules/gm/lib/getters.js:70:16)\n   在cb   (/var/www/projects/mywebsite/dist/node_modules/gm/lib/command.js:322:16)\n   在gm._spawn   (/var/www/projects/mywebsite/dist/node_modules/gm/lib/command.js:226:14)\n   在gm._exec   (/var/www/projects/mywebsite/dist/node_modules/gm/lib/command.js:190:17)\n   at gm.proto。(匿名函数)[大小]   (/var/www/projects/mywebsite/dist/node_modules/gm/lib/getters.js:68:12)\n   在   /var/www/projects/mywebsite/dist/node_modules/gulp-image-resize/index.js:46:16\n   在fn   (/var/www/projects/mywebsite/dist/node_modules/gulp-image-resize/node_modules/async/lib/async.js:582:34)\n   在立即。   (/var/www/projects/mywebsite/dist/node_modules/gulp-image-resize/node_modules/async/lib/async.js:498:34)\n   在runCallback(timers.js:574:20)\ n在tryOnImmediate   (timers.js:554:5)\ n at processImmediate [as _immediateCallback]   (timers.js:533:5)"" isOperational":真,"电平":"错误""时间戳&#34 ;:" 2016-11-11T15:07:11.378Z"}

我已将文件夹权限更改为755但仍遇到错误。请帮我解决这个问题。

我使用ng-file-upload进行文件上传。

客户端代码,

this.uploadLogo = function ($files, institute) {
    var def = $q.defer();
    var file = $files[0];
    if (file.size < 5000000) {
        $upload.upload({
            url: 'api/logo',
            method: 'POST',
            file: file,
            data: myformdata
        }).success(function (resp) {
            def.resolve(resp);
        }).error(function (err) {
            def.reject(err);
        });
    }

    return def.promise;
};

0 个答案:

没有答案