blackbeam / poppler-simple

A simple javascript interface to poppler library
Apache License 2.0
37 stars 14 forks source link

Error: Cannot find module '../build/default/poppler' #32

Closed msageryd closed 4 years ago

msageryd commented 4 years ago

I just installed poppler and poppler-simple on a new OSX machine (Catalina).

When I try to use poppler-simple I get: Error: Cannot find module '../build/default/poppler'

There is no such folder. But there is a ../build/Release/poppler

Did I miss something in the installation? The first installation attempt failed due to missing pkg-config. This was solved with brew install pkg-config.

I tried to rm -rf node_modules and start over, but the problem did not go away.

The poppler-simple install seems to go well, but there is one warning: ld: warning: dylib (/usr/local/Cellar/poppler/20.09.0/lib/libpoppler.dylib) was built for newer macOS version (10.15) than being linked (10.10)

blackbeam commented 4 years ago

Hi. Thanks for report. Which nodejs and npm versions do you use?

msageryd commented 4 years ago

I'm using NVM. Tried with Node 10.16.2 and 12.18.4

The last time I used popper-simple was a couple of years ago. I used Node 8 at that time (remember this because I wrote it in the docker.example file).

edit: To clarify, this time I'm not using Docker. The problem is on OSX.

On 22 Sep 2020, 21:00 +0200, Anatoly I notifications@github.com, wrote:

Hi. Thanks for report. Which nodejs and npm versions do you use?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/blackbeam/poppler-simple/issues/32#issuecomment-696917453, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABCGQDJXL5MDBZAS6REHWA3SHDX3VANCNFSM4RV3EGOA.

blackbeam commented 4 years ago

Should work in v0.9.0.

msageryd commented 4 years ago

Thank you. Unfortunately it still doesn't work for me. I removed poppler-simple and npm installed it again.

poppler-simple looks like this in my node_modules folder. Still no default folder under build: image

I package.json in this module says 0.9.0, so the install seems to have worked.

blackbeam commented 4 years ago

Ok. Then can you please try to load poppler.node manually? Something like this from poppler-simple directory:

require('./build/Release/poppler');
blackbeam commented 4 years ago

Still no default folder under build:

The default folder is just the last one of many folders, that the library will probe during startup. That's why it is in the error message (I'll improve error reporting). The actual error is hidden and, I believe, is emitted here:

https://github.com/blackbeam/poppler-simple/blob/a7f9702b7ccc7bdc1395432d164a45ecc33140b1/lib/poppler.js#L7-L9

That's why I asked you to perform this require manually.

In my case the error was Unknown symbol ... and I've fixed it in 23c1c9e.

blackbeam commented 4 years ago

Closed due to inactivity. Feel free to reopen.