本文介绍了我可以在适用于Linux的Azure应用服务上使用phantomJS吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在节点应用程序中使用html-pdf软件包时出现一致错误:

I'm getting a consistent error when trying to use the html-pdf package in my node application:

StatusError: Error: spawn /home/site/wwwroot/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT

据我所知,一切均已正确安装,并且npm install可以正常工作.我怀疑内置的Linux映像中缺少一些依赖项,但是我不确定如何确认.

As far as I can tell everything is installed correctly and the npm install works as expected. My suspicion is that there is some missing dependency in the built-in linux image, but I'm not sure how to confirm that.

推荐答案

该信息来自 页,以下是Linux发行版的两个注意事项.

According to the information comes from the Download PhantomJS page, there is two note for Linux Distributions as below.

因此,本机软件包fontconfiglibfontconfig必须首先安装在Docker映像中.

So the native package fontconfig or libfontconfig must have been installed in docker image first.

对于Debian/Ubuntu系统,您可以在docker文件中添加RUN apt install fontconfig,并通过命令dpkg -l|grep fontconfig检查安装的软件包是否存在.

For Debian/Ubuntu system, you can add RUN apt install fontconfig in the docker file, and check the package installed whether be exists via the command dpkg -l|grep fontconfig.

对于Fedora/CentOS系统,添加RUN yum install -y fontconfig,然后通过yum list installed|grep fontconfig检查安装情况.

For Fedora/CentOS system, add RUN yum install -y fontconfig, and check the installed on via yum list installed|grep fontconfig.

这篇关于我可以在适用于Linux的Azure应用服务上使用phantomJS吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 23:22