Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package poppler was not found in the pkg-config search path #22

Closed
msageryd opened this issue Oct 31, 2018 · 8 comments
Closed

Package poppler was not found in the pkg-config search path #22

msageryd opened this issue Oct 31, 2018 · 8 comments

Comments

@msageryd
Copy link
Contributor

I'm not able to build poppler-simple. I've tried a lot of combos.

  • Node 6, 8, 10
  • OSX
  • Debian (via docker)
  • Alpine (via Docker)

Poppler installs fine in all the above scenarios (using brew, apt-get and apk respectively), but npm install gives the following error.

Does anyone have any clue? I did get poppler-simple to work on another computer (not available anymore). I'd really like to get this running in a Docker container.

Perhaps you should add the directory containing `poppler.pc'
to the PKG_CONFIG_PATH environment variable
Package 'poppler', required by 'virtual:world', not found
gyp: Call to 'pkg-config --libs poppler' returned exit status 1 while in binding.gyp. 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.9.93-linuxkit-aufs
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure"
gyp ERR! cwd /tmp/node_modules/poppler-simple
gyp ERR! node -v v10.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
@blackbeam
Copy link
Owner

blackbeam commented Oct 31, 2018

Hi.
Please try to run pkg-config --libs poppler in your environment and inspect the output.

I found some random ubuntu for an example and got the following output:

~$ pkg-config --libs poppler
The program 'pkg-config' can be found in the following packages:
 * pkg-config
 * pkgconf
Try: sudo apt install <selected package>

i.e. pkg-config is not installed, but pkg-config it required for build script to work.

@msageryd
Copy link
Contributor Author

Thanks.
I think pkg-config is installed correctly, as the error message comes from pkg-config.

Could it be the other way around, i.e. the package directory in pkg-config does not contain poppler or points to the wrong path.

Does anyone know where poppler.pc resides? Actually I can't find it at all..

I should probably try to add this path to PKG_CONFIG_PATH if I find it.

@msageryd
Copy link
Contributor Author

Here is the Dockerfile. I've stripped it down to the essentials about poppler. I now realise that this has nothing with poppler-simple to do. But I'm hoping someone here has any clue anyway.

N.B. I also tried with FROM alpine to ensure that node doesn't interfere. Same result..

FROM node:10-alpine
RUN apk --update --upgrade add pkgconfig python poppler
RUN pkg-config --libs poppler

The result is:

Step 4/4 : RUN pkg-config --libs poppler
 ---> Running in 66f5ff01a56f
Package poppler was not found in the pkg-config search path.
Perhaps you should add the directory containing `poppler.pc'
to the PKG_CONFIG_PATH environment variable

@blackbeam
Copy link
Owner

Looks like poppler pc files is in poppler-dev package.
https://pkgs.alpinelinux.org/contents?branch=edge&name=poppler-dev&arch=aarch64&repo=main

@msageryd
Copy link
Contributor Author

msageryd commented Nov 1, 2018

Thanks, this got me a bit further. I installed poppled-dev instead of popplerand got rid of the pkg-config error. Unfortunately I got a bunch of new errors. I tried with Node 4, 6, 8 and 10.

The console gets flooded with messages, but here is the last part:

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.9.93-linuxkit-aufs
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/node_modules/poppler-simple
gyp ERR! node -v v10.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! poppler-simple@0.3.0 install: `(node-gyp rebuild) || (exit 1)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the poppler-simple@0.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

The console flood starts like this:

make: Entering directory '/tmp/node_modules/poppler-simple/build'
  CXX(target) Release/obj.target/poppler/src/poppler.o
In file included from ../node_modules/nan/nan_new.h:189:0,
                 from ../node_modules/nan/nan.h:222,
                 from ../src/poppler.cc:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function 'static Nan::imp::FactoryBase<v8::StringObject>::return_t Nan::imp::Factory<v8::StringObject>::New(v8::Local<v8::String>)':
../node_modules/nan/nan_implementation_12_inl.h:340:37: warning: 'static v8::Local<v8::Value> v8::StringObject::New(v8::Local<v8::String>)' is deprecated: Use Isolate* version [-Wdeprecated-declarations]
   return v8::StringObject::New(value).As<v8::StringObject>();
                                     ^
In file included from /root/.node-gyp/10.12.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/10.12.0/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:52,
                 from ../src/poppler.cc:1:
/root/.node-gyp/10.12.0/include/node/v8.h:5053:37: note: declared here
                 static Local<Value> New(Local<String> value));

Here is the much simplified Dockerfile I'm trying to get working:

FROM node:10-alpine

RUN apk --update add alpine-sdk pkgconfig poppler-dev bash
COPY package.json /tmp/package.json
RUN cd /tmp && npm install

And the package.json

{
  "name": "poppler-test",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "poppler-simple": "^0.3.0"
  }
}

@blackbeam
Copy link
Owner

There is a lot of flood during build but looks like everything works with node:8-alpine.
Please swith to it if possible. I will schedule update for node v10.

@msageryd
Copy link
Contributor Author

msageryd commented Nov 1, 2018

Thanks again.
That's great news. I tried all Node versions and assumed the same error due to the flood of bright red messages. But now I see that the actual outcome is "success" on Node 8.

Thank you very much for your help. Would you like me to send you a PR with a small write-up on installing on Docker? I think it could help many others to get going wit poppler-simple.

@blackbeam
Copy link
Owner

Would you like me to send you a PR with a small write-up on installing on Docker?

Great idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants