这是indexloc提供的服务,不要输入任何密码
Skip to content

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

@JZ-314

Description

@JZ-314

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'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions