简体   繁体   English

如何使用node.js和node-imagemagick修复此错误:错误:命令失败:execvp():权限被拒绝?

[英]How do I fix this error with node.js and node-imagemagick: Error: Command failed: execvp(): Permission denied?

Im getting this error: 我收到此错误:

Error: Command failed: execvp(): Permission denied

When I do a simple node-imagemagick script: 当我做一个简单的node-imagemagick脚本时:

im = require('imagemagick');
im.identify.path = '/tmp/node_thumbs/';
im.identify('cool.jpg',function(err,features){
  if(err) throw err;
  console.log(features);
});

Any ideas on what could be causing this? 关于什么可能导致此的任何想法?

The permission denied is from trying to launch the ImageMagick command, not in the process of executing it. 被拒绝的权限是由于尝试启动ImageMagick命令而不是在执行过程中。

If you look at the documentation , identify.path is "Path to the identify program." 如果查看文档 ,则identify.path是“标识程序的路径”。 In this case, you're redefining the path to the executable as /tmp/node_thumbs/, which presumably is not the executable. 在这种情况下,您将重新定义可执行文件的路径为/ tmp / node_thumbs /,这大概不是可执行文件。

You probably simply want: 您可能只想要:

var im = require("imagemagick");
im.identify('/tmp/node_thumbs/cool.jpg',function...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM