pdf2html icon indicating copy to clipboard operation
pdf2html copied to clipboard

Error: Failed downloading dependency tika-app-2.6.0.jar

Open SBerda opened this issue 1 year ago • 3 comments

Hi, I'm getting this error : .../[email protected]/node_modules/pdf2html postinstall: throw new Error(Failed downloading dependency ${filename}.); .../[email protected]/node_modules/pdf2html postinstall: ^ .../[email protected]/node_modules/pdf2html postinstall: Error: Failed downloading dependency tika-app-2.6.0.jar. .../[email protected]/node_modules/pdf2html postinstall: at ClientRequest.<anonymous> (/builds/infrastructure/applications_slack/patchs_data/millenium/node_modules/.pnpm/[email protected]/node_modules/pdf2html/postinstall.js:27:23) .../[email protected]/node_modules/pdf2html postinstall: at ClientRequest.emit (node:events:518:28) .../[email protected]/node_modules/pdf2html postinstall: at TLSSocket.socketErrorListener (node:_http_client:495:9) .../[email protected]/node_modules/pdf2html postinstall: at TLSSocket.emit (node:events:518:28) .../[email protected]/node_modules/pdf2html postinstall: at emitErrorNT (node:internal/streams/destroy:169:8) .../[email protected]/node_modules/pdf2html postinstall: at emitErrorCloseNT (node:internal/streams/destroy:128:3) .../[email protected]/node_modules/pdf2html postinstall: at process.processTicksAndRejections (node:internal/process/task_queues:82:21) .../[email protected]/node_modules/pdf2html postinstall: Node.js v20.11.0 .../[email protected]/node_modules/pdf2html postinstall: Failed Anyone having the same ? Thank you

SBerda avatar Mar 01 '24 07:03 SBerda

Are you a server in China mainland? Finally I build it locally and upload to the server.

toknT avatar May 23 '24 09:05 toknT

You can download the dependencies manually following this guide https://github.com/shebinleo/pdf2html?tab=readme-ov-file#manually-download-dependencies-files

shebinleo avatar May 23 '24 09:05 shebinleo

@shebinleo unfortunately, in some environment the postinstall.js failed and will not create node_modules

ubuntu@VM-0-17-ubuntu ~/t/test-project (master) [126]> npm install
npm WARN deprecated @types/[email protected]: This is a stub types definition. graphql-relay provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated @apollo/[email protected]: The use of GraphQL Playground in Apollo Server was supported in previous versions, but this is no longer the case as of December 31, 2022. This package exists for v4 migration purposes only. We do not intend to resolve security issues or other bugs with this package if they arise, so please migrate away from this to [Apollo Server's default Explorer](https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages) as soon as possible.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net
npm WARN deprecated [email protected]: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm ERR! code 1
npm ERR! path /home/ubuntu/tmp/test-project/node_modules/pdf2html
npm ERR! command failed
npm ERR! command sh -c node postinstall.js
npm ERR! Started downloading dependency pdfbox-app-2.0.27.jar.
npm ERR! Started downloading dependency tika-app-2.6.0.jar.
npm ERR! /home/ubuntu/tmp/test-project/node_modules/pdf2html/postinstall.js:27
npm ERR!                 throw new Error(`Failed downloading dependency ${filename}.`);
npm ERR!                 ^
npm ERR!
npm ERR! Error: Failed downloading dependency pdfbox-app-2.0.27.jar.
npm ERR!     at ClientRequest.<anonymous> (/home/ubuntu/tmp/test-project/node_modules/pdf2html/postinstall.js:27:23)
npm ERR!     at ClientRequest.emit (node:events:514:28)
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:495:9)
npm ERR!     at TLSSocket.emit (node:events:514:28)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR!     at runNextTicks (node:internal/process/task_queues:64:3)
npm ERR!     at listOnTimeout (node:internal/timers:540:9)
npm ERR!     at process.processTimers (node:internal/timers:514:7)
npm ERR!
npm ERR! Node.js v20.10.0

npm ERR! A complete log of this run can be found in: /home/ubuntu/.npm/_logs/2024-05-24T03_51_21_406Z-debug-0.log
ubuntu@VM-0-17-ubuntu ~/t/test-project (master) [1]> cd node_modules/pdf2html/vendor
cd: The directory “node_modules/pdf2html/vendor” does not exist
ubuntu@VM-0-17-ubuntu ~/t/test-project (master) [1]>                          

maybe you should remove throw new Error in postinstall.js and write

npm install --save pdf2html
cd node_modules/pdf2html/vendor
wget https://archive.apache.org/dist/pdfbox/2.0.27/pdfbox-app-2.0.27.jar
wget https://archive.apache.org/dist/tika/2.6.0/tika-app-2.6.0.jar

in README

toknT avatar May 24 '24 03:05 toknT