简体   繁体   English

流星 EPIPE 错误中的 html-pdf

[英]html-pdf in meteor EPIPE error

I have a Meteor app that renders a PDF server-side using html-pdf .我有一个 Meteor 应用程序,它使用html-pdf呈现 PDF 服务器端。 The app is deployed with mup .该应用程序是使用mup部署的。 Locally, everything works fine.在本地,一切正常。 Upon deployment, I see this error in the server logs:部署后,我在服务器日志中看到此错误:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: write EPIPE
    at errnoException (net.js:905:11)
    at Object.afterWrite (net.js:721:19)
error: Forever detected script exited with code: 8
error: Script restart attempt #1

Versions of stuff:版本的东西:

  • Ubuntu 14.04.2 LTS Ubuntu 14.04.2 LTS
  • Meteor 1.0.4.2流星 1.0.4.2
  • Node.js 0.10.37 Node.js 0.10.37
  • mup 0.9.7最大 0.9.7

Summary概括

The fix: sudo apt-get install libfontconfig修复: sudo apt-get install libfontconfig

Details细节

I noticed that html-pdf depends on and installs phantomjs itself.我注意到html-pdf依赖并安装了phantomjs本身。 I found a couple of compiled phantomjs binaries:我找到了几个编译好的phantomjs二进制文件:

/opt/testapp/app/programs/server/npm/testpackage/node_modules/html-pdf/node_modules/phantomjs/bin/phantomjs
/opt/testapp/app/programs/server/npm/testpackage/node_modules/html-pdf/node_modules/phantomjs/lib/phantom/bin/phantomjs

When I tried to run either binary directly, I got this error:当我尝试直接运行任一二进制文件时,出现此错误:

error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

A web search turned up this secret dependency .网络搜索发现了这个秘密依赖

This problem occurs also in Ubuntu v18.04.5这个问题也在 Ubuntu v18.04.5 中出现

After install the below command it was working fine for me.安装以下命令后,它对我来说工作正常。

sudo apt-get install libfontconfig

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

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