Saturday 15 April 2017

AWS Elastic Beanstalk install Poppler and Cairo for node module

I have a node app that uses this PDF library: https://github.com/tpisto/pdf-fill-form

In the installation instructions it read you should install sudo apt-get install libpoppler-qt5-dev libcairo2-dev

On default Beanstalk Amazon Linux distribution I can't use apt-get, but I found poppler and cario in the amazon package repo. So in my .ebextensions config I have the following packages

packages:
  yum:
    gcc: []
    poppler: []
    poppler-data: []
    cairo: []

But when I deploy, npm install fails... any idea how to get those libraries working, so npm install come sthrough?

in eb-activity.log it reads:

Package Qt5Core was not found in the pkg-config search path.
  Perhaps you should add the directory containing `Qt5Core.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'Qt5Core' found
  Package Qt5Gui was not found in the pkg-config search path.
  Perhaps you should add the directory containing `Qt5Gui.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'Qt5Gui' found
  Package cairo was not found in the pkg-config search path.
  Perhaps you should add the directory containing `cairo.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'cairo' found
  Package poppler-qt5 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `poppler-qt5.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'poppler-qt5' found
  gyp: Call to 'pkg-config --libs Qt5Core Qt5Gui cairo poppler-qt5' returned exit status 1. while trying to load binding.gyp
  gyp ERR! configure error 
  gyp ERR! stack Error: `gyp` failed with exit code: 1
  gyp ERR! stack     at ChildProcess.onCpExit (/opt/elasticbeanstalk/node-install/node-v0.12.6-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
  gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
  gyp ERR! System Linux 3.14.48-33.39.amzn1.x86_64
  gyp ERR! command "node" "/opt/elasticbeanstalk/node-install/node-v0.12.6-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
  gyp ERR! cwd /tmp/deployment/application/node_modules/pdf-fill-form
  gyp ERR! node -v v0.12.6
  gyp ERR! node-gyp -v v2.0.1
  gyp ERR! not ok



via florian norbert bepunkt

No comments:

Post a Comment