domenic / worm-scraper

Scrapes the web serial Worm, its sequel Ward, and the bridge series Glow-worm into an ebook format
Other
210 stars 48 forks source link

Issue with running convert.js when no pre-existing "staging" path #30

Closed Chocbanana closed 2 years ago

Chocbanana commented 3 years ago

When running worm-scraper convert... , if there is no pre-existing "staging" path (aka upon fresh run), it gives this error: (node:6172) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead And that means fs.rmdir no longer allows for no existing path with the recursive: true arg.

The fix is to simply change line 90 in worm-scraper.js to the following: return fs.rm(chaptersPath, { force: true, recursive: true, maxRetries: 3 }) And that made it work for me.

gorman42 commented 2 years ago

I needed to apply the suggested fix to have the latest version (4.12.1) work for me. Thanks Chocbanana for sharing it. Much appreciated.