allitebooks-downloader icon indicating copy to clipboard operation
allitebooks-downloader copied to clipboard

Path contains invalid characters error

Open arphox opened this issue 6 years ago • 1 comments

Hi!

Since You did not mention which node.js version to install, I used "12.13.0". However the script crashed early:

e:\e-library\_allitebooks_\allitebooks-downloader-master>npm start

> [email protected] start e:\e-library\_allitebooks_\allitebooks-downloader-master
> node main.js

PAGE: http://www.allitebooks.com/
DETAIL: http://www.allitebooks.org/software-engineering-from-scratch/
(node:1272) UnhandledPromiseRejectionWarning: Error: Path contains invalid characters: undefined/http:/www.allitebooks.org/software-engineering-from-scratch/
    at checkPath (e:\e-library\_allitebooks_\allitebooks-downloader-master\node_modules\make-dir\index.js:18:16)
    at e:\e-library\_allitebooks_\allitebooks-downloader-master\node_modules\make-dir\index.js:26:2
    at async e:\e-library\_allitebooks_\allitebooks-downloader-master\main.js:52:5
(node:1272) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1272) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Can you help me with this issue? (I also tried earler LTS versions of node.js, did not work)

arphox avatar Nov 07 '19 07:11 arphox

I am using the argv[2] to read the current path of the script and use that as a download path. It seems that that does not work in your setting, since the prepended download path is undefined in your error message

Error: Path contains invalid characters: undefined/http:/www.allitebooks.org/software-engineering-from-scratch/

The error message you posted also looks like you are using Windows. Maybe argv[2] works different on WIndows. I have so far only used this on macOS.

But feel free to debug into this and hand in a pull request!

thomasbrueggemann avatar Nov 07 '19 16:11 thomasbrueggemann