2

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

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.

Shaun Rowan
  • 8,261
  • 4
  • 26
  • 49

1 Answers1

0

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

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.

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

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.

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

Peter Pan
  • 20,663
  • 4
  • 18
  • 35
  • Are there any resources outlining how to use a custom image with azure app service? How do I find out which type of system is being used? My assumption is the underlying docker file being used is https://github.com/Azure-App-Service/node/blob/master/8.11.4/Dockerfile – Shaun Rowan Jan 04 '19 at 15:44
  • Haven't really solved the issue, but marking as the correct answer since it aligns with my research as well. Not sure how great of a solution this can be long term. Microsoft installs a lot of the tooling as part of their image, so it seems like forking it is likely to cause a lot of maintenance headaches and portal incompatibilities in the future. – Shaun Rowan Jan 04 '19 at 15:47