browningluke / mangathr-legacy

A terminal client for downloading manga, with support for sites like MangaDex, Cubari and more.
MIT License
4 stars 1 forks source link

MODULE_NOT_FOUND #8

Closed Drun555 closed 1 year ago

Drun555 commented 2 years ago

First of all - thank you for your work. This thing is exactly what I need, there's just no other utility to dump MangaDex with ComicsInfo.xml. And "subscribe" ability is very promising. This should be absolutely ideal companion for Komga.

Unfortunately, after installing I get error listed below. I tried to re-install module-alias in the mangathr folder, but had no success. Is there anything else I should try to do?

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module '../dist/main'
Require stack:
- /usr/local/lib/node_modules/mangathr/bin/mangathr.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._resolveFilename (/usr/local/lib/node_modules/mangathr/node_modules/module-alias/index.js:49:29)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/mangathr/bin/mangathr.js:4:17)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/local/lib/node_modules/mangathr/bin/mangathr.js' ]
}
browningluke commented 2 years ago

Hey there, thanks for your comment! I'm glad someone finds it useful :). Just for your information, this repo isn't as actively maintained as it probably should be. I started working on mangathrV2 (a Go rewrite, but a WIP) which seeks to do everything this does, and more.

Regarding your issue, did you install it with npm install -g mangathr or build it from source?

If you built it from source, you might have forgotten to run npm run build.

Drun555 commented 2 years ago

Firstly I tried to install it with regular way and catched this issue, then I tried to build - without success too, unfortunately. I have this issue on my Raspberry Pi 4 and M1 Mac, both working on aarch64 architecture - perhaps, it could be a problem.

browningluke commented 2 years ago

It was an error on my end, the build CI/CD was releasing without building first for some reason.

I've patched that and created a new release. Please try a npm install -g mangathr again, and let me know!

Drun555 commented 2 years ago

Thank you for the fix :) MODULE error is gone, but, unfortunately, now I'm receiving different issue. Maybe I should just wait for Go-rewrite version :)

UPD: I commented mangaplus.js string in plugins/index.js, since I not really need it anyway. Now this thing is working as expected. Thank you again for your work!

/usr/local/lib/node_modules/mangathr/dist/plugins/mangaplus.js:43
            "Session-Token": crypto_1.default.randomUUID()
                                              ^

TypeError: crypto_1.default.randomUUID is not a function
    at new MangaPlus (/usr/local/lib/node_modules/mangathr/dist/plugins/mangaplus.js:43:47)
    at Object.<anonymous> (/usr/local/lib/node_modules/mangathr/dist/plugins/index.js:17:25)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/mangathr/dist/commands/manage.js:18:19)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
browningluke commented 2 years ago

No worries! Indeed, I was having a few issues with Node.js so I jumped ship to Go. I'll make some doc commits tomorrow in that other repo to hopefully get you started with it :)

What command were you running that gave that error by the way? With a fresh install on my end, running mangathr download mangaplus ... works.

Edit: just saw your update! Glad it's working :)

browningluke commented 2 years ago

It looks like the crypto package is very deprecated at this point. Not sure why it was still working for me. Just released a hotfix replacing it.

A npm update -g mangathr should hopefully get you working without having to comment it out. 😄