You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importfetchfrom"node-fetch";// download the filefetch("https://almoasercourse.com/wp-content/uploads/2021/12/52-5.jpg").then((res)=>{constdest=fs.createWriteStream("image.jpg");res.body.pipe(dest);});
I got an error:
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
^
FetchError: request to https://almoasercourse.com/wp-content/uploads/2021/12/52-5.jpg failed, reason: connect ETIMEDOUT 2600:4c00:80:bc::27d:443
at ClientRequest.<anonymous> (C:\Users\conta\Desktop\test2\node_modules\node-fetch\lib\index.js:1505:11)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:494:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I try to download image using node-fetch
I got an error:
I'm sure image is exist in the web
Beta Was this translation helpful? Give feedback.
All reactions