ThatTSGuy / discord-qr-token-grabber

Grabs Discord tokens using their QR code authentication API
MIT License
7 stars 7 forks source link

Error: Cannot find module '@napi-rs/canvas-linux-x64-gnu' #4

Closed Saadat01 closed 2 years ago

Saadat01 commented 2 years ago
mint@mint:~$ ./discord-qr-token-grabber-linux 
pkg/prelude/bootstrap.js:1876
      throw error;
      ^

Error: Cannot find module '@napi-rs/canvas-linux-x64-gnu'
Require stack:
- /snapshot/discord-qr-token-grabber/node_modules/@napi-rs/canvas/js-binding.js
- /snapshot/discord-qr-token-grabber/node_modules/@napi-rs/canvas/index.js
- /snapshot/discord-qr-token-grabber/image.js
- /snapshot/discord-qr-token-grabber/qr-auth-session/index.js
- /snapshot/discord-qr-token-grabber/index.js
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
    at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
    at Module._load (node:internal/modules/cjs/loader:787:27)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at Module.require (pkg/prelude/bootstrap.js:1855:31)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/snapshot/discord-qr-token-grabber/node_modules/@napi-rs/canvas/js-binding.js:138:31)
    at Module._compile (pkg/prelude/bootstrap.js:1930:22)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/snapshot/discord-qr-token-grabber/node_modules/@napi-rs/canvas/js-binding.js',
    '/snapshot/discord-qr-token-grabber/node_modules/@napi-rs/canvas/index.js',
    '/snapshot/discord-qr-token-grabber/image.js',
    '/snapshot/discord-qr-token-grabber/qr-auth-session/index.js',
    '/snapshot/discord-qr-token-grabber/index.js'
  ],
  pkg: true
}

NodeJS version : v18.5.0 NPM version : 8.13.2 OS : Linux Mint 20.3

ThatTSGuy commented 2 years ago

The problem here is that the canvas library I'm using does dynamic requiring of libraries depending on the OS you're on. My packager doesn't know to also pack the Linux lib. I can look for a fix, but I don't have a Linux computer to test on.

Saadat01 commented 2 years ago

You can use virtual machines or online IDE like Replit and goormIDE to test the fix for Linux.

ThatTSGuy commented 2 years ago

Replit and goorm don't allow executables to be ran and my laptop can't run an vm. Try the most recent release, I bundled the Skia Linux directly into it.

Saadat01 commented 2 years ago

It still doesn't work on Linux even at version 1.1

ThatTSGuy commented 2 years ago

There's not much I can do; I can't download the Linux NPM package as I'm not on Linux.

Saadat01 commented 2 years ago

@ThatTSGuy What NodeJS and NPM version did you use ?