Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Chocbanana opened this issue Sep 1, 2021 · 1 comment · Fixed by #32
Closed

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

Chocbanana opened this issue Sep 1, 2021 · 1 comment · Fixed by #32

Comments

@Chocbanana
Copy link

Chocbanana commented Sep 1, 2021

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.

eyoung8 added a commit to eyoung8/worm-scraper that referenced this issue Sep 23, 2021
resolves domenic#30 

All credit to Chocbanana who opened domenic#30. Figured I'd just make a PR to make this easier.

I hit this error when creating a ward epub myself and came to the issues to find a solution.
This worked for me locally.

The bug presents as follows:
```
*downloads*
Downloading https://www.parahumans.net/2020/05/02/last-20-end/... done
(node:19428) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: ENOENT: no such file or directory, stat 'C:\Users\evane\Documents\staging\ward\OEBPS\chapters'
```
@gorman42
Copy link

gorman42 commented Jan 6, 2022

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.

domenic pushed a commit that referenced this issue Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants