download icon indicating copy to clipboard operation
download copied to clipboard

GotError [RequestError]: connect ETIMEOUT error to donwload pdf files

Open JZ-314 opened this issue 2 years ago • 0 comments

I am downloading pdf files from online ulrs using download module in node.js. But When I download pdf files, that error is showed. How to fix this error?

I used my code like this. pdfArr.forEach(async (url) => { await download(url, pdfDir) .then(() => { console.log(pdfArr.length, index); if (index === pdfArr.length - 1) { return res.status(200).json({ success: true, data: index }); } index++; }); });

error:

GotError [RequestError]: connect ETIMEDOUT 170.131.2.12:80 at ClientRequest. (C:\project\node_modules\got\index.js:182:22) at Object.onceWrapper (node:events:510:26) at ClientRequest.emit (node:events:390:28) at Socket.socketErrorListener (node:_http_client:447:9) at Socket.emit (node:events:390:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'ETIMEDOUT', host: 'host.com', hostname: 'host.com', method: 'GET', path: '/pdf/642736.pdf', protocol: 'http:', url: 'http://pdf/642736.pdf' }

JZ-314 avatar Jan 16 '22 03:01 JZ-314