我可以在适用于Linux的Azure应用服务上使用phantomJS吗? [英] Can I use phantomJS on Azure app service for linux?

查看:143
本文介绍了我可以在适用于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.

注意:对于此静态版本,二进制文件是独立的.不需要安装Qt,WebKit或任何其他库.但是,它仍然依赖于Fontconfig(包 fontconfig libfontconfig ,具体取决于发行版).系统必须具有 GLIBCXX_3.4.9 GLIBC_2.7 .

Note: For this static build, the binary is self-contained. There is no requirement to install Qt, WebKit, or any other libraries. It however still relies on Fontconfig (the package fontconfig or libfontconfig, depending on the distribution). The system must have GLIBCXX_3.4.9 and GLIBC_2.7.

因此,本机软件包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吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆