我正在尝试使用Dropbox轻子NodeJS Package来压缩图像。但是,当我在我的NodeJS Express App中运行以下代码时,下面是我得到的错误。
有人可以建议我如何解决此错误?
以下是我尝试运行的代码。
var myLepton = require('node-lepton');
myLepton.compress('http://www.barth.com/hires/N10_JB07006.jpg',
{
unjailed: false,
},
function(err, data){
if(err) throw err;
console.log("data : "+JSON.stringify(data, null, 4));
console.log('Successfully compressed image');
});
以下是我获得的错误:
Error: Command failed: lepton -memory=1024M -threadmemory=128M http://www.barth.com/hires/N10_JB07006.jpg 51di81xl3g.lep
/bin/sh: lepton: command not found
at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:554:12)