abdulrahman1s / fem-dl

Frontend Masters Course Downloader That actually works.
https://npmjs.com/package/fem-dl
The Unlicense
164 stars 28 forks source link

Error "no such file or directory" even though directory is created #17

Open gKits opened 1 year ago

gKits commented 1 year ago

When I'm trying to download a course a directory for the first chapter is created in my Downloads directory and then it fails with this error code.
I'm running the program via the recommended way pnpm dlx fem-dl.

⠧ [0%] Downloading 1. Introduction/1. Introduction.mp4 | Size: 0KB | Remaining: 1/60node:internal/process/esm_loader:42
      internalBinding('errors').triggerUncaughtException(
                                ^

[Error: ENOENT: no such file or directory, copyfile '/home/me/Downloads/The Last Algorithms Course You'll Need/1. Introduction/Introduction.tmp.mp4' -> '/home/me/Downloads/The Last Algorithms Course You'll Need/1. Introduction/1. Introduction.mp4'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'copyfile',
  path: "/home/me/Downloads/The Last Algorithms Course You'll Need/1. Introduction/Introduction.tmp.mp4",
  dest: "/home/me/Downloads/The Last Algorithms Course You'll Need/1. Introduction/1. Introduction.mp4"
}

Node.js v20.2.0
 ERROR  Command failed with exit code 1: fem-dl

pnpm: Command failed with exit code 1: fem-dl
    at makeError (/usr/lib/node_modules/pnpm/dist/pnpm.cjs:24242:17)
    at handlePromise (/usr/lib/node_modules/pnpm/dist/pnpm.cjs:24813:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.handler [as dlx] (/usr/lib/node_modules/pnpm/dist/pnpm.cjs:223506:7)
    at async /usr/lib/node_modules/pnpm/dist/pnpm.cjs:232908:21
    at async main (/usr/lib/node_modules/pnpm/dist/pnpm.cjs:232875:34)
    at async runPnpm (/usr/lib/node_modules/pnpm/dist/pnpm.cjs:233130:5)
    at async /usr/lib/node_modules/pnpm/dist/pnpm.cjs:233122:7
mragab commented 1 year ago

Same issue when running from within a docker container based on the node:18 image. I tried running fem-dl using npx and pnpm and ended up with the same error above.

MarvinXu commented 5 months ago

Same issue when running from WSL. It works on CMD or PowerShell