错误:html-pdf:收到 lambda nodejs 中'127'的退出代码



我正在使用"html pdf";lambda函数中的模块。下面是我的代码

await pdf.create(html, options).toStream(async function (err, stream) {
if(err) {
return err;
}
let fileName = NAME_OF_FILE;
let key = KEY;
let data = await s3Upload(key, stream) // function to upload to s3
});

代码在本地似乎运行良好。但在lambda中,我得到了这个错误

错误:html pdf:收到退出代码"127"/var/task/node_modules/fintomjs prebuilded/lib/phantom/bin/fintomJS:加载共享库时出错:libfontconfig.so.1:无法打开共享对象文件:没有这样的文件或目录

有什么想法吗?提前感谢!

适用于Ubuntu 18.04.5sudo apt-get install -y libfontconfigsudo apt-get install -y libfreetype6

这对我有用。我从这里得到了推荐信https://github.com/ariya/phantomjs/issues/13597

相关内容

最新更新