{
"errorType": "Error",
"errorMessage": "write EPIPE",
"code": "EPIPE",
"stack": [
"Error: write EPIPE",
" at WriteWrap.afterWrite [as oncomplete] (net.js:779:14)"
],
"errno": "EPIPE",
"syscall": "write"
}
{
"errorType": "Error",
"errorMessage": "html-pdf: Received the exit code '127'\n./phantomjs_lambda/phantomjs_linux-x86_64: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory\n",
"stack": [
"Error: html-pdf: Received the exit code '127'",
"./phantomjs_lambda/phantomjs_linux-x86_64: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory",
"",
" at ChildProcess.respond (/var/task/node_modules/html-pdf/lib/pdf.js:121:31)",
" at ChildProcess.emit (events.js:189:13)",
" at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)"
]
}
如果我使用最新的Linux二进制文件而不是与此存储库一起提供的文件,则会出现有关不同但类似的错误,指出缺少不同的.so文件。
为了背景,我想安装phantomjs是因为我想在我的lambda中使用node html-pdf library。
我使用的是Mac。
作为答案,我不是要解决这个具体的错误,只是要找到一个能在AWS Lambda上运行的可用的phantomjs。如果有另一个不需要phantomjs工作并且可以轻松在AWS Lambda上运行的节点“html to pdf” /“html to png”库,那也是可以接受的解决方案。