ibrod83 / nodejs-file-downloader

129 stars 23 forks source link

tempPath is not defind #53

Closed VixiaID closed 1 year ago

VixiaID commented 1 year ago

I create function download with this package, but error. Below is the error:

/root/project/aoi/node_modules/nodejs-file-downloader/Download.js:298
                await this._removeFailedFile(tempPath)
                                             ^

ReferenceError: tempPath is not defined
    at Download._save (/root/project/aoi/node_modules/nodejs-file-downloader/Download.js:298:46)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Download._getFinalPath (/root/project/aoi/node_modules/nodejs-file-downloader/Download.js:224:25)
    at async Download.start (/root/project/aoi/node_modules/nodejs-file-downloader/Download.js:111:31)
    at async Downloader.<anonymous> (/root/project/aoi/node_modules/nodejs-file-downloader/Downloader.js:130:14)
    at async /root/project/aoi/node_modules/nodejs-file-downloader/Downloader.js:149:14
    at async /root/project/aoi/node_modules/nodejs-file-downloader/utils/rpur.js:64:28
ibrod83 commented 1 year ago

Can you show me the code?

ibrod83 commented 1 year ago

I had a problem in my code, where tempPath was handled. Please update to version 4.11.1. Bear in mind, that this part of the code is called only when a download fails, so you might be facing a different underlying issue