0

I'm using html-pdf to generate and pdf on my nodejs app, which is then being uploaded to S3. This works fine on my local, but I face this error

Error: spawn /usr/local/bin/phantomjs ENOENT

when running the deployed app on EBS. I have added a config file under .ebextensions with the below content to install phantomjs, but it doesn't seem to fix the problem.

  01_install_dependencies:
    command: sudo yum install -y fontconfig freetype freetype-devel fontconfig-devel libstdc++
  02_download_phantomjs:
    command: wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
  03_prepare_dir:
    command: sudo mkdir -p /opt/phantomjs
  04_unbzip2:
    command: bzip2 -df phantomjs-2.1.1-linux-x86_64.tar.bz2
  05_untar:
    command: sudo tar -xvf phantomjs-2.1.1-linux-x86_64.tar --directory /opt/phantomjs/ --strip-components 1
  06_symlink:
    command: sudo ln -fs /opt/phantomjs/bin/phantomjs /usr/bin/phantomjs

PS: This used to work earlier, but I recently upgraded the node platform version on EBS, as well as the versions of a few github action runners (node, ubuntu, deploy). Not quite sure if these had anything to do with it.

Karthik
  • 114
  • 2
  • 11

0 Answers0