When I try to run pdf2json
(without any parameters at all) I'm getting this error:
/usr/lib/node_modules/pdf2json/lib/p2jcmd.js:63
#continue(callback, err) {
^
SyntaxError: Unexpected token '('
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/lib/node_modules/pdf2json/bin/pdf2json:3:16)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
Here's the Dockerfile I tried to run it in:
FROM debian:bullseye
RUN apt-get update \
&& apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs \
&& npm install pdf2json -g
Any ideas?
Quoting https://github.com/modesty/pdf2json/issues/250:
The solution is to do
npm install --save-exact [email protected]
.